Issues (23)

src/Extensions/CWPPageExtension.php (2 issues)

1
<?php
2
3
namespace CWP\AgencyExtensions\Extensions;
4
5
use SilverStripe\Core\Extension;
6
use SilverStripe\SiteConfig\SiteConfig;
7
8
/**
9
 * Class CWPPageExtension
10
 *
11
 * @property Page_Controller $owner
12
 */
13
class CWPPageExtension extends Extension
14
{
15
    /**
16
     * See BasePage_Controller::results()
17
     *
18
     * @param CwpSearchResult $results
0 ignored issues
show
The type CWP\AgencyExtensions\Extensions\CwpSearchResult 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...
19
     * @param array $properties
20
     */
21
    public function updateSearchResults(&$results, &$properties)
0 ignored issues
show
The parameter $results 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

21
    public function updateSearchResults(/** @scrutinizer ignore-unused */ &$results, &$properties)

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...
22
    {
23
        // Customise empty results
24
        $customNoSearchResultsText = SiteConfig::current_site_config()->NoSearchResults;
25
        if ($customNoSearchResultsText) {
26
            $properties['NoSearchResults'] = $customNoSearchResultsText;
27
        }
28
29
        // Customise empty search
30
        $customEmptyText = SiteConfig::current_site_config()->EmptySearch;
31
        if ($customEmptyText) {
32
            $properties['EmptySearch'] = $customEmptyText;
33
        }
34
    }
35
}
36