Issues (42)

src/SermonHelper.php (2 issues)

1
<?php
2
3
namespace FaithGen\Sermons;
4
5
use FaithGen\SDK\Helpers\Helper;
6
use FaithGen\SDK\Helpers\MinistryHelper;
0 ignored issues
show
The type FaithGen\SDK\Helpers\MinistryHelper was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use FaithGen\SDK\SDK;
0 ignored issues
show
The type FaithGen\SDK\SDK was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use FaithGen\Sermons\Models\Sermon;
9
10
class SermonHelper extends Helper
11
{
12
    public static $freeSermonsCount = 2;
13
14
    public static function getImageLink($imageName, int $dimen = 0)
15
    {
16
        if (! $imageName) {
17
            return MinistryHelper::getImageLink(auth()->user(), $dimen);
18
        }
19
        if (! $dimen) {
20
            return SDK::getAsset('storage/sermons/original/'.$imageName);
21
        } else {
22
            return SDK::getAsset('storage/sermons/'.$dimen.'-'.$dimen.'/'.$imageName);
23
        }
24
    }
25
26
    public static function getAvatar(Sermon $sermon)
27
    {
28
        return [
29
            '_50' => ! $sermon->image()->exists() ? self::getImageLink(null, 50) : self::getImageLink($sermon->image->name, 50),
30
            '_100' => ! $sermon->image()->exists() ? self::getImageLink(null, 100) : self::getImageLink($sermon->image->name, 100),
31
            'original' => ! $sermon->image()->exists() ? self::getImageLink(null, 0) : self::getImageLink($sermon->image->name, 0),
32
        ];
33
    }
34
}
35