8
8
* License: GNU/GPLv2
9
9
* @see LICENSE.txt
10
10
*
11
- * This file: The scanner (last modified: 2021.01.10 ).
11
+ * This file: The scanner (last modified: 2021.03.11 ).
12
12
*/
13
13
14
14
namespace phpMussel \Core ;
@@ -314,8 +314,9 @@ public function scan($Files, int $Format = 0)
314
314
* @param string|array $Files Supplied by the scan method.
315
315
* @param int $Depth Represents the current depth of recursion from which the
316
316
* method has been called.
317
+ * @return void
317
318
*/
318
- private function recursor ($ Files = '' , int $ Depth = -1 )
319
+ private function recursor ($ Files = '' , int $ Depth = -1 ): void
319
320
{
320
321
/** Fire event: "atStartOf_recursor". */
321
322
$ this ->Loader ->Events ->fireEvent ('atStartOf_recursor ' );
@@ -716,8 +717,9 @@ private function recursor($Files = '', int $Depth = -1)
716
717
* scanned (in this context, referring to the name supplied by the upload
717
718
* client or CLI operator, as opposed to the temporary filename assigned
718
719
* by the server or anything else).
720
+ * @return void
719
721
*/
720
- private function dataHandler (string $ str = '' , int $ Depth = 0 , string $ OriginalFilename = '' )
722
+ private function dataHandler (string $ str = '' , int $ Depth = 0 , string $ OriginalFilename = '' ): void
721
723
{
722
724
/** Fire event: "atStartOf_dataHandler". */
723
725
$ this ->Loader ->Events ->fireEvent ('atStartOf_dataHandler ' );
@@ -2339,9 +2341,10 @@ private function dataHandler(string $str = '', int $Depth = 0, string $OriginalF
2339
2341
* needed (because the zip and rar classes require a file pointer).
2340
2342
* @param int $ScanDepth The current scan depth (supplied during recursion).
2341
2343
* @param string $ItemRef A reference to the parent container (for logging).
2344
+ * @return void
2342
2345
* @throws Exception if the metadata scanner throws an exception (forwarded on).
2343
2346
*/
2344
- private function archiveRecursor (string $ Data , string $ File = '' , int $ ScanDepth = 0 , string $ ItemRef = '' )
2347
+ private function archiveRecursor (string $ Data , string $ File = '' , int $ ScanDepth = 0 , string $ ItemRef = '' ): void
2345
2348
{
2346
2349
/** Fire event: "atStartOf_archiveRecursor". */
2347
2350
$ this ->Loader ->Events ->fireEvent ('atStartOf_archiveRecursor ' );
@@ -2687,8 +2690,10 @@ private function archiveRecursor(string $Data, string $File = '', int $ScanDepth
2687
2690
2688
2691
/**
2689
2692
* Initialise statistics if they've been enabled.
2693
+ *
2694
+ * @return void
2690
2695
*/
2691
- public function statsInitialise ()
2696
+ public function statsInitialise (): void
2692
2697
{
2693
2698
/** Guard. */
2694
2699
if (!$ this ->Loader ->Configuration ['core ' ]['statistics ' ]) {
@@ -2724,8 +2729,9 @@ public function statsInitialise()
2724
2729
*
2725
2730
* @param string $Statistic The statistic to increment.
2726
2731
* @param int $Amount The amount to increment it by.
2732
+ * @return void
2727
2733
*/
2728
- public function statsIncrement (string $ Statistic , int $ Amount )
2734
+ public function statsIncrement (string $ Statistic , int $ Amount ): void
2729
2735
{
2730
2736
/** Guard. */
2731
2737
if (!$ this ->Loader ->Configuration ['core ' ]['statistics ' ] || !isset ($ this ->Loader ->InstanceCache ['Statistics ' ][$ Statistic ])) {
@@ -2738,8 +2744,10 @@ public function statsIncrement(string $Statistic, int $Amount)
2738
2744
2739
2745
/**
2740
2746
* Fetch information about signature files for the scan process.
2747
+ *
2748
+ * @return void
2741
2749
*/
2742
- private function organiseSigFiles ()
2750
+ private function organiseSigFiles (): void
2743
2751
{
2744
2752
/** Guard. */
2745
2753
if (empty ($ this ->Loader ->Configuration ['signatures ' ]['active ' ]) || !$ this ->Loader ->SignaturesPath ) {
@@ -3597,8 +3605,9 @@ private function confineLength(int $Length): bool
3597
3605
* @param string $Checksum
3598
3606
* @param int $StringLength
3599
3607
* @param int $Depth
3608
+ * @return void
3600
3609
*/
3601
- private function detected (string $ VN , string $ OriginalFilename , string $ Checksum , int $ StringLength , int $ Depth )
3610
+ private function detected (string $ VN , string $ OriginalFilename , string $ Checksum , int $ StringLength , int $ Depth ): void
3602
3611
{
3603
3612
/** Prepare detection text. */
3604
3613
$ Text = sprintf ($ this ->Loader ->L10N ->getString ('grammar_exclamation_mark ' ), sprintf (
@@ -3631,8 +3640,9 @@ private function detected(string $VN, string $OriginalFilename, string $Checksum
3631
3640
* @param string|int $Initial The start of the boundary or string initial offset value.
3632
3641
* @param string|int $Terminal The end of the boundary or string terminal offset value.
3633
3642
* @param array $SectionOffsets Section offset values.
3643
+ * @return void
3634
3644
*/
3635
- private function dataConfineByOffsets (string &$ Data , &$ Initial , &$ Terminal , array &$ SectionOffsets )
3645
+ private function dataConfineByOffsets (string &$ Data , &$ Initial , &$ Terminal , array &$ SectionOffsets ): void
3636
3646
{
3637
3647
/** Guard. */
3638
3648
if ($ Initial === '* ' && $ Terminal === '* ' ) {
@@ -3738,8 +3748,9 @@ private function splitSigParts(string $Sig, int $Max = -1): array
3738
3748
* @param int $Depth The depth of the item being scanned in relation to its
3739
3749
* container and/or its hierarchy within the scan process.
3740
3750
* @param string $Checksum A hash for the content, inherited from the parent.
3751
+ * @return void
3741
3752
*/
3742
- private function metaDataScan (string $ ItemRef , string $ Filename , string &$ Data , int $ Depth , string $ Checksum )
3753
+ private function metaDataScan (string $ ItemRef , string $ Filename , string &$ Data , int $ Depth , string $ Checksum ): void
3743
3754
{
3744
3755
$ Depth ++;
3745
3756
@@ -3903,8 +3914,9 @@ private function convertCrx(string &$Data): bool
3903
3914
* Assigns an array to use for dumping scan debug information (optional).
3904
3915
*
3905
3916
* @param array $Arr
3917
+ * @return void
3906
3918
*/
3907
- public function setScanDebugArray (&$ Arr )
3919
+ public function setScanDebugArray (&$ Arr ): void
3908
3920
{
3909
3921
unset($ this ->debugArr );
3910
3922
if (!is_array ($ Arr )) {
@@ -3917,17 +3929,20 @@ public function setScanDebugArray(&$Arr)
3917
3929
* Destroys the scan debug array (optional).
3918
3930
*
3919
3931
* @param array $Arr
3932
+ * @return void
3920
3933
*/
3921
- public function destroyScanDebugArray (&$ Arr )
3934
+ public function destroyScanDebugArray (&$ Arr ): void
3922
3935
{
3923
3936
unset($ this ->Loader ->InstanceCache ['DebugArrKey ' ], $ this ->debugArr );
3924
3937
$ Arr = null ;
3925
3938
}
3926
3939
3927
3940
/**
3928
3941
* Reset heuristics.
3942
+ *
3943
+ * @return void
3929
3944
*/
3930
- private function resetHeuristics ()
3945
+ private function resetHeuristics (): void
3931
3946
{
3932
3947
$ this ->HeuristicText = [];
3933
3948
$ this ->HeuristicCount = 0 ;
0 commit comments