mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Update PHPStan and Safe PHP, and review codebase for further type correctness
This commit is contained in:
parent
e2e14a3551
commit
9d1b66d19e
35 changed files with 301 additions and 169 deletions
|
@ -36,6 +36,9 @@ class Museum{
|
|||
|
||||
$parsedUrl['path'] = $parsedUrl['path'] ?? '';
|
||||
|
||||
// We've initialized `$parsedUrl`, formally define it for PHPStan.
|
||||
/** @var array{'path': string, 'host': string, 'fragment'?: string, 'query'?: string} $parsedUrl */
|
||||
|
||||
// We can't match on TLD because extracting the TLD for double-barrel TLDs, like .gov.uk, requires a whitelist.
|
||||
|
||||
if(preg_match('/\brijksmuseum\.nl$/ius', $parsedUrl['host'])){
|
||||
|
@ -112,10 +115,6 @@ class Museum{
|
|||
throw new Exceptions\InvalidMuseumUrlException($url, $exampleUrl);
|
||||
}
|
||||
|
||||
if($parsedUrl['path'] != '/eMP/eMuseumPlus'){
|
||||
throw new Exceptions\InvalidMuseumUrlException($url, $exampleUrl);
|
||||
}
|
||||
|
||||
parse_str($parsedUrl['query'] ?? '', $vars);
|
||||
|
||||
if(!isset($vars['objectId']) || is_array($vars['objectId'])){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue