mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-12 11:34:09 +02:00
ci: disallow the sizeof function in linter (#4134)
This commit is contained in:
@@ -347,17 +347,17 @@ class ItakuBridge extends BridgeAbstract
|
||||
$url = self::URI . "/api/galleries/images/?by_following=false&date_range={$opt['range']}&ordering={$opt['order']}&is_video={$opt['video_only']}";
|
||||
$url .= "&text={$opt['text']}&visibility=PUBLIC&visibility=PROFILE_ONLY&page=1&page_size=30&format=json";
|
||||
|
||||
if (sizeof($opt['optional_tags']) > 0) {
|
||||
if (count($opt['optional_tags']) > 0) {
|
||||
foreach ($opt['optional_tags'] as $tag) {
|
||||
$url .= "&optional_tags=$tag";
|
||||
}
|
||||
}
|
||||
if (sizeof($opt['negative_tags']) > 0) {
|
||||
if (count($opt['negative_tags']) > 0) {
|
||||
foreach ($opt['negative_tags'] as $tag) {
|
||||
$url .= "&negative_tags=$tag";
|
||||
}
|
||||
}
|
||||
if (sizeof($opt['required_tags']) > 0) {
|
||||
if (count($opt['required_tags']) > 0) {
|
||||
foreach ($opt['required_tags'] as $tag) {
|
||||
$url .= "&required_tags=$tag";
|
||||
}
|
||||
@@ -381,17 +381,17 @@ class ItakuBridge extends BridgeAbstract
|
||||
$url = self::URI . "/api/posts/?by_following=false&date_range={$opt['range']}&ordering={$opt['order']}";
|
||||
$url .= '&visibility=PUBLIC&visibility=PROFILE_ONLY&page=1&page_size=30&format=json';
|
||||
|
||||
if (sizeof($opt['optional_tags']) > 0) {
|
||||
if (count($opt['optional_tags']) > 0) {
|
||||
foreach ($opt['optional_tags'] as $tag) {
|
||||
$url .= "&optional_tags=$tag";
|
||||
}
|
||||
}
|
||||
if (sizeof($opt['negative_tags']) > 0) {
|
||||
if (count($opt['negative_tags']) > 0) {
|
||||
foreach ($opt['negative_tags'] as $tag) {
|
||||
$url .= "&negative_tags=$tag";
|
||||
}
|
||||
}
|
||||
if (sizeof($opt['required_tags']) > 0) {
|
||||
if (count($opt['required_tags']) > 0) {
|
||||
foreach ($opt['required_tags'] as $tag) {
|
||||
$url .= "&required_tags=$tag";
|
||||
}
|
||||
@@ -446,7 +446,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
|
||||
private function getPost($id, array $metadata = null)
|
||||
{
|
||||
if (isset($metadata) && sizeof($metadata['gallery_images']) < $metadata['num_images']) {
|
||||
if (isset($metadata) && count($metadata['gallery_images']) < $metadata['num_images']) {
|
||||
$metadata = null; //force re-fetch of metadata
|
||||
}
|
||||
$uri = self::URI . '/posts/' . $id;
|
||||
@@ -457,7 +457,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
$content_str = nl2br($data['content']);
|
||||
$content = "<p>{$content_str}</p><br/>"; //TODO: Add link and itaku user mention detection and convert into links.
|
||||
|
||||
if (array_key_exists('tags', $data) && sizeof($data['tags']) > 0) {
|
||||
if (array_key_exists('tags', $data) && count($data['tags']) > 0) {
|
||||
$tag_types = [
|
||||
'ARTIST' => '',
|
||||
'COPYRIGHT' => '',
|
||||
@@ -479,7 +479,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($data['folders']) > 0) {
|
||||
if (count($data['folders']) > 0) {
|
||||
$content .= '📁 In Folder(s): ';
|
||||
foreach ($data['folders'] as $folder) {
|
||||
$url = self::URI . '/profile/' . $data['owner_username'] . '/posts/' . $folder['id'];
|
||||
@@ -488,7 +488,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
}
|
||||
|
||||
$content .= '<hr/>';
|
||||
if (sizeof($data['gallery_images']) > 0) {
|
||||
if (count($data['gallery_images']) > 0) {
|
||||
foreach ($data['gallery_images'] as $media) {
|
||||
$title = $media['title'];
|
||||
$url = self::URI . '/images/' . $media['id'];
|
||||
@@ -529,7 +529,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
$content_str = nl2br($data['description']);
|
||||
$content = "<p>{$content_str}</p><br>"; //TODO: Add link and itaku user mention detection and convert into links.
|
||||
|
||||
if (array_key_exists('tags', $data) && sizeof($data['tags']) > 0) {
|
||||
if (array_key_exists('tags', $data) && count($data['tags']) > 0) {
|
||||
// $content .= "🏷 Tag(s): ";
|
||||
$tag_types = [
|
||||
'ARTIST' => '',
|
||||
@@ -552,7 +552,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('reference_gallery_sections', $data) && sizeof($data['reference_gallery_sections']) > 0) {
|
||||
if (array_key_exists('reference_gallery_sections', $data) && count($data['reference_gallery_sections']) > 0) {
|
||||
$content .= '📁 Example folder(s): ';
|
||||
foreach ($data['folders'] as $folder) {
|
||||
$url = self::URI . '/profile/' . $data['owner_username'] . '/gallery/' . $folder['id'];
|
||||
@@ -601,7 +601,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
$content_str = nl2br($data['description']);
|
||||
$content = "<p>{$content_str}</p><br/>"; //TODO: Add link and itaku user mention detection and convert into links.
|
||||
|
||||
if (array_key_exists('tags', $data) && sizeof($data['tags']) > 0) {
|
||||
if (array_key_exists('tags', $data) && count($data['tags']) > 0) {
|
||||
// $content .= "🏷 Tag(s): ";
|
||||
$tag_types = [
|
||||
'ARTIST' => '',
|
||||
@@ -624,7 +624,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('sections', $data) && sizeof($data['sections']) > 0) {
|
||||
if (array_key_exists('sections', $data) && count($data['sections']) > 0) {
|
||||
$content .= '📁 In Folder(s): ';
|
||||
foreach ($data['sections'] as $folder) {
|
||||
$url = self::URI . '/profile/' . $data['owner_username'] . '/gallery/' . $folder['id'];
|
||||
|
Reference in New Issue
Block a user