@@ -109,22 +109,17 @@ protected function handleDelete(array $items)
109109
110110 private function getRandomExpression (string $ name , string $ expression ): CronExpression
111111 {
112- if (\class_exists (\Random \Engine \Xoshiro256StarStar::class, false )) {
113- // Generate stable, but differing values for each (instance, cronjob) pair.
114- $ randomizer = new \Random \Randomizer (new \Random \Engine \Xoshiro256StarStar (
115- \hash ('sha256 ' , \sprintf (
116- '%s:%s:%d:%s ' ,
117- \WCF_UUID ,
118- self ::class,
119- $ this ->installation ->getPackageID (),
120- $ name
121- ), true )
122- ));
123- $ engine = static fn (int $ min , int $ max ) => $ randomizer ->getInt ($ min , $ max );
124- } else {
125- // A seedable engine is not available, use completely random values.
126- $ engine = \random_int (...);
127- }
112+ // Generate stable, but differing values for each (instance, cronjob) pair.
113+ $ randomizer = new \Random \Randomizer (new \Random \Engine \Xoshiro256StarStar (
114+ \hash ('sha256 ' , \sprintf (
115+ '%s:%s:%d:%s ' ,
116+ \WCF_UUID ,
117+ self ::class,
118+ $ this ->installation ->getPackageID (),
119+ $ name
120+ ), true )
121+ ));
122+ $ engine = $ randomizer ->getInt (...);
128123
129124 return new CronExpression (match ($ expression ) {
130125 '@hourly ' => \sprintf ('%d * * * * ' , $ engine (0 , 59 )),
0 commit comments