texnixe / kirby3-similar

Find similar collection items based on similarity
28 stars 2 forks source link

PHP 8.2 compatibility #5

Closed mynameisfreedom closed 1 year ago

mynameisfreedom commented 1 year ago

Hi @texnixe!

Just to remind you when you have time make Kirby3 Similar plugin compatible with PHP 8.2.

Thank you!

fsennj commented 1 year ago

any news on 8.2?

Getting that error: Creation of dynamic property Kirby\Cms\Page::$jaccardIndex is deprecated

protected function filterByJaccardIndex(array $searchItems)
{
    return $this->index->map(function ($item) use ($searchItems) {
        **$item->jaccardIndex = $this->calculateSimilarityIndex($item, $searchItems);**
Bildschirmfoto 2023-05-07 um 19 50 11
        return $item;
    })->filterBy('jaccardIndex', '>=', $this->threshold)->sortBy('jaccardIndex', 'desc');
}
tobimori commented 1 year ago

Hi @texnixe, you'll have to create a new release (3.0.1) for the version requirement in aa05686a091999531f3b13b50e4c7cf482bede9d to apply to composer installations. Could you kindly do that?