Skip to content

Commit

Permalink
Add support for Silverstripe 5
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispenny committed Feb 14, 2023
1 parent 2bae9f6 commit 8a905fe
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 75 deletions.
13 changes: 5 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@
},
{
"name": "Chris Penny",
"email": "cpenny@silverstripe.com"
"email": "chris.penny@gmail.com"
}
],
"support": {
"issues": "http://github.com/ichaber/silverstripe-swiftype/issues"
},
"require": {
"php": "^7.4 || ^8.0",
"silverstripe/vendor-plugin": "^1.6",
"silverstripe/framework": "^4",
"silverstripe/cms": "^4",
"guzzlehttp/guzzle": "^7",
"guzzlehttp/psr7": "^2"
"php": "^8.1",
"silverstripe/cms": "^5",
"guzzlehttp/guzzle": "^7.5"
},
"require-dev": {
"silverstripe/recipe-testing": "^2"
"silverstripe/recipe-testing": "^3"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 1 addition & 4 deletions src/Extensions/SwiftypeSiteConfigFieldsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
*/
class SwiftypeSiteConfigFieldsExtension extends DataExtension
{
/**
* @var array $db
*/
private static $db = [
private static array $db = [
'SwiftypeEnabled' => 'Boolean',
'SwiftypeAccessKey' => 'Varchar(255)',
'SwiftypeAPIKey' => 'Varchar(255)',
Expand Down
4 changes: 1 addition & 3 deletions src/Extensions/SwiftypeSiteTreeCrawlerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ class SwiftypeSiteTreeCrawlerExtension extends SiteTreeExtension
* Urls to crawl
*
* array keyed by getOwnerKey
*
* @var array
*/
private $urlsToCrawl = [];
private array $urlsToCrawl = [];

public function setUrlsToCrawl(array $urls)
{
Expand Down
15 changes: 3 additions & 12 deletions src/MetaTags/SwiftypeMetaTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,11 @@ abstract class SwiftypeMetaTag implements SwiftypeMetaTagInterface
{
use Configurable;

/**
* @var string|null
*/
protected $name;
protected ?string $name;

/**
* @var string|null
*/
protected $fieldName;
protected ?string $fieldName;

/**
* @var string|null
*/
protected $fieldType;
protected ?string $fieldType;

public function getMetaTagString(DataObject $dataObject): ?string
{
Expand Down
15 changes: 3 additions & 12 deletions src/MetaTags/SwiftypeMetaTagDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@

class SwiftypeMetaTagDescription extends SwiftypeMetaTag
{
/**
* @var string
*/
protected $name = 'description';
protected ?string $name = 'description';

/**
* @var string
*/
protected $fieldName = 'MetaDescription';
protected ?string $fieldName = 'MetaDescription';

/**
* @var string
*/
protected $fieldType = 'text';
protected ?string $fieldType = 'text';
}
15 changes: 3 additions & 12 deletions src/MetaTags/SwiftypeMetaTagPublishedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@

class SwiftypeMetaTagPublishedAt extends SwiftypeMetaTag
{
/**
* @var string
*/
protected $name = 'published_at';
protected ?string $name = 'published_at';

/**
* @var string
*/
protected $fieldName = 'LastEdited';
protected ?string $fieldName = 'LastEdited';

/**
* @var string
*/
protected $fieldType = 'date';
protected ?string $fieldType = 'date';
}
15 changes: 3 additions & 12 deletions src/MetaTags/SwiftypeMetaTagTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@

class SwiftypeMetaTagTitle extends SwiftypeMetaTag
{
/**
* @var string
*/
protected $name = 'title';
protected ?string $name = 'title';

/**
* @var string
*/
protected $fieldName = 'Title';
protected ?string $fieldName = 'Title';

/**
* @var string
*/
protected $fieldType = 'string';
protected ?string $fieldType = 'string';
}
15 changes: 3 additions & 12 deletions src/MetaTags/SwiftypeMetaTagURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@

class SwiftypeMetaTagURL extends SwiftypeMetaTag
{
/**
* @var string
*/
protected $name = 'url';
protected ?string $name = 'url';

/**
* @var string|null
*/
protected $fieldName = 'Link';
protected ?string $fieldName = 'Link';

/**
* @var string
*/
protected $fieldType = 'enum';
protected ?string $fieldType = 'enum';
}

0 comments on commit 8a905fe

Please sign in to comment.