Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silverstripe 5.3 compatibility #8

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Model/TaxonomyTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
* Represents a single taxonomy term. Can be re-ordered in the CMS, and the default sorting is to use the order as
* specified in the CMS.
*
* @property string $Name
* @property ?string $Name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some existing annotations, added the remaining for completeness

* @property int $Sort
* @property bool $Protected
* @method TaxonomyType Type()
* @property int $TypeID
*/
class TaxonomyTerm extends DataObject implements PermissionProvider
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/Traits/TaxonomyTrait.php
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should resolve #6

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ trait TaxonomyTrait
/**
* Helper to find a taxonomy type either by ID or name
*
* @param int|String $type
* @return TaxonomyType
* @param int|string $type
* @return ?TaxonomyType
*/
public static function findTaxonomyType($type)
{
Expand All @@ -27,8 +27,8 @@ public static function findTaxonomyType($type)
/**
* Return taxonomy terms for a type specified as a string
*
* @param string $type
* @return DataList
* @param int|string $type
* @return ArrayList<TaxonomyTerm>|DataList<TaxonomyTerm>
*/
public static function getTermsForType($type)
{
Expand Down