The screenshot check uses a files list that is generated in the required_files_check method and stored in $missing_files. The way that files are added to the array that's in the property is not compatible with the check that is done inside of screenshot_check.
The check looks at root keys for the comparison but the files are added inside an indexed array at root level.
Additionally if the check is modified to correctly compare the key (IE if it is pre-determined there is a missing screenshot) then the method returns null which results in a fatal error later on the code when it is accessed.
The screenshot check uses a files list that is generated in the
required_files_check
method and stored in$missing_files
. The way that files are added to the array that's in the property is not compatible with the check that is done inside ofscreenshot_check
.https://github.com/WPTRT/theme-sniffer/blob/98d3b2fdf8370633eb823a19c9ef3127aff4e8d9/src/callback/class-run-sniffer-callback.php#L808
https://github.com/WPTRT/theme-sniffer/blob/98d3b2fdf8370633eb823a19c9ef3127aff4e8d9/src/callback/class-run-sniffer-callback.php#L844
The check looks at root keys for the comparison but the files are added inside an indexed array at root level.
Additionally if the check is modified to correctly compare the key (IE if it is pre-determined there is a missing screenshot) then the method returns
null
which results in a fatal error later on the code when it is accessed.https://github.com/WPTRT/theme-sniffer/blob/98d3b2fdf8370633eb823a19c9ef3127aff4e8d9/src/callback/class-run-sniffer-callback.php#L844-L847
https://github.com/WPTRT/theme-sniffer/blob/98d3b2fdf8370633eb823a19c9ef3127aff4e8d9/src/callback/class-run-sniffer-callback.php#L492