M src/FeedFinder.php => src/FeedFinder.php +1 -0
@@ 90,6 90,7 @@ final class FeedFinder
$finders[] = new $className();
}
}
+ usort($finders, fn($a, $b) => $a::INDEX <=> $b::INDEX);
return $finders;
}
M src/Finder.php => src/Finder.php +5 -0
@@ 5,6 5,11 @@ namespace Thirdplace;
abstract class Finder
{
+ /**
+ * This const is used for ordering (sorting)
+ */
+ public const INDEX = 50;
+
public const NAME = 'Generic name';
public const DESCRIPTION = 'Generic description';
M src/finders/Feeds.php => src/finders/Feeds.php +2 -0
@@ 5,6 5,8 @@ namespace Thirdplace;
final class Feeds extends Finder
{
+ public const INDEX = 90;
+
private array $feeds;
public function __construct(array $feeds)
M src/finders/Html.php => src/finders/Html.php +2 -0
@@ 8,6 8,8 @@ namespace Thirdplace;
*/
final class Html extends Finder
{
+ public const INDEX = 90;
+
const NAME = 'RSS auto-discovery';
const DESCRIPTION = 'This feed was found parsing the html.';