Skip to content

Commit 61645ec

Browse files
committed
Start working through CMS 6 support
1 parent 71b900b commit 61645ec

7 files changed

Lines changed: 13 additions & 9 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"require-dev": {
2828
"silverstripe/recipe-cms": "^6",
2929
"phpunit/phpunit": "^11.3",
30-
"slevomat/coding-standard": "^8.8"
30+
"slevomat/coding-standard": "~8.18.0"
3131
},
3232
"repositories": [
3333
{

phpcs.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<file>src</file>
66
<file>tests</file>
77

8+
<!-- Don't sniff test classes, because they include PHP attributes that cause Slevomat to throw errors -->
9+
<exclude-pattern>./tests/*</exclude-pattern>
810
<!-- Don't sniff third party libraries -->
911
<exclude-pattern>./vendor/*</exclude-pattern>
1012
<exclude-pattern>*/thirdparty/*</exclude-pattern>
@@ -148,6 +150,8 @@
148150
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
149151
<!-- Leave group order up to us -->
150152
<exclude name="SlevomatCodingStandard.Classes.ClassStructure.IncorrectGroupOrder"/>
153+
<!-- Leave the order up to us to decide -->
154+
<exclude name="SlevomatCodingStandard.Classes.ClassStructure.IncorrectGroupOrder"/>
151155
</rule>
152156

153157
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">

src/Constants/SearchFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class SearchFile
1616
/**
1717
* File size limit in bytes
1818
*/
19-
public const SIZE_LIMIT = 15 * 1024 * 1024;
19+
public const int SIZE_LIMIT = 15 * 1024 * 1024;
2020

2121
public static function sizeLimit(): string
2222
{

src/Extensions/FileExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
use SilverStripe\Assets\Folder;
77
use SilverStripe\Assets\Image;
88
use SilverStripe\Core\Convert;
9+
use SilverStripe\Core\Extension;
910
use SilverStripe\ForagerBifrost\Constants\SearchFile;
10-
use SilverStripe\ORM\DataExtension;
1111

1212
/**
1313
* @property int $ContentSize
1414
* @method File|$this getOwner()
1515
*/
16-
class FileExtension extends DataExtension
16+
class FileExtension extends Extension
1717
{
1818

1919
/**

src/Reports/LargeDocumentReport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use SilverStripe\Assets\File;
66
use SilverStripe\ForagerBifrost\Constants\SearchFile;
7-
use SilverStripe\ORM\SS_List;
7+
use SilverStripe\Model\List\SS_List;
88
use SilverStripe\Reports\Report;
99

1010
class LargeDocumentReport extends Report

src/Service/BifrostService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getDocumentationURL(): ?string
4545
return sprintf('%s/api/v1/docs', $this->getExternalURL());
4646
}
4747

48-
private const DEFAULT_FIELD_TYPE = 'text';
48+
private const string DEFAULT_FIELD_TYPE = 'text';
4949

5050
private Client $client;
5151

src/Service/ClientFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
class ClientFactory implements Factory
1515
{
1616

17-
private const ENDPOINT = 'BIFROST_ENDPOINT';
18-
private const QUERY_API_KEY = 'BIFROST_QUERY_API_KEY';
17+
private const string ENDPOINT = 'BIFROST_ENDPOINT';
18+
private const string QUERY_API_KEY = 'BIFROST_QUERY_API_KEY';
1919

2020
/**
2121
* @throws Exception
2222
*/
23-
public function create($service, array $params = []) // phpcs:ignore SlevomatCodingStandard.TypeHints
23+
public function create(string $service, array $params = []): ?object
2424
{
2525
$host = $params['host'] ?? null;
2626
$token = $params['token'] ?? null;

0 commit comments

Comments
 (0)