Fix/fix various linting errors#337
Fix/fix various linting errors#337John-Holt-Tessella merged 22 commits intopre-release/2022-R4.3-PHP-upgradefrom
Conversation
…ful to share with other tests)
api/src/Page/DC.php
Outdated
| $dc['FILETEMPLATE'] = preg_replace('/.*\/'.$this->arg('prop').'-'.$dc['VN'].'\//', '', $dc['FILETEMPLATE']); | ||
|
|
||
| $nf = array(2 => array('EXPOSURETIME'), 2 => array('AXISSTART', 'RESOLUTION', 'TRANSMISSION')); | ||
| $nf = array(1 => array('EXPOSURETIME'), 2 => array('AXISSTART', 'RESOLUTION', 'TRANSMISSION')); |
There was a problem hiding this comment.
I don't know if this is correct! But what was there was not correct (EXPOSURETIME is just lost due to the second, repeat definition, of '2'). @JPHall-DLS can you double check this, please?
There was a problem hiding this comment.
It's inverted, the keys represent the precision to round to (read down a bit). Right now that means EXPOSURETIME is not rounded. 1 sig fig is too small for EXPOSURETIME, add it to the 2 array. (only for energy scans, data collections are fine)
Line 950 in 90a3156
There was a problem hiding this comment.
Ah, that's helpful - thanks, Stuart!
| private function configExitIfNoMicroscopes() | ||
| { | ||
| if (count($this->_get_beamlines_from_type('em')) == 0) { | ||
| if (count($this->_get_beamlines_from_type('em', false)) == 0) { |
There was a problem hiding this comment.
Not sure why, but the linter didn't seem happy this was a missing optional input - so to get rid of the error, just set it directly.
The Psalm linter that was added in the previous pull request flagged about 40 errors. The changes here get this down to 5.
Some of these errors were just style/warning type things, however there are some genuine bugs in there too - so I think this has been a worthwhile exercise.