extgalleryNotifyIteminfo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    {@link https://xoops.org/ XOOPS Project}
14
 * @license      {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
15
 * @author      XOOPS Development Team,
16
 */
17
18
use XoopsModules\Extgallery;
19
20
/**
21
 * @param $category
22
 * @param $item_id
23
 *
24
 * @return mixed
25
 */
26
function extgalleryNotifyIteminfo($category, $item_id)
0 ignored issues
show
Unused Code introduced by
The parameter $category is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
function extgalleryNotifyIteminfo(/** @scrutinizer ignore-unused */ $category, $item_id)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
{
28
    /** @var Extgallery\PublicPhotoHandler $photoHandler */
29
    /** @var Extgallery\Photo $photo */
30
31
    $photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
32
    $photo        = $photoHandler->getPhoto($item_id);
33
    $item['name'] = $photo->getVar('photo_desc');
0 ignored issues
show
Comprehensibility Best Practice introduced by
$item was never initialized. Although not strictly required by PHP, it is generally a good practice to add $item = array(); before regardless.
Loading history...
34
    $item['url']  = XOOPS_URL . '/modules/extgallery/public-album.php?id=' . $photo->getVar('photo_id');
35
36
    return $item;
37
}
38