mirror of
https://github.com/friendica/friendica
synced 2025-04-26 22:30:18 +00:00
Changes:
- 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:
parent
074bae33c9
commit
cfa575b8e5
10 changed files with 71 additions and 35 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue