- added missing type-hints
- added documentation
- removed parameter $baseURL while it can be locally get the same way but
  lesser parameter
- used ActivityNamespace::SALMON_ME
- changed double-quotes to single
This commit is contained in:
Roland Häder 2022-08-12 14:00:02 +02:00
parent 074bae33c9
commit cfa575b8e5
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
10 changed files with 71 additions and 35 deletions

View file

@ -73,6 +73,7 @@ class DomainPatternBlocklist
/**
* @param string $pattern
* @param string $reason
*
* @return int 0 if the block list couldn't be saved, 1 if the pattern was added, 2 if it was updated in place
*/
public function addPattern(string $pattern, string $reason): int
@ -105,6 +106,7 @@ class DomainPatternBlocklist
/**
* @param string $pattern
*
* @return int 0 if the block list couldn't be saved, 1 if the pattern wasn't found, 2 if it was removed
*/
public function removePattern(string $pattern): int
@ -123,6 +125,13 @@ class DomainPatternBlocklist
return $found ? ($this->set($blocklist) ? 2 : 0) : 1;
}
/**
* @param string $filename
*
* @return void
* @throws Exception
* @todo maybe throw more explicit exception
*/
public function exportToFile(string $filename)
{
$fp = fopen($filename, 'w');
@ -165,6 +174,7 @@ class DomainPatternBlocklist
* Extracts a server domain pattern block list from the provided CSV file name. Deduplicates the list based on patterns.
*
* @param string $filename
*
* @return array
* @throws Exception
*/