Skip to content
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: 2 additions & 2 deletions app/actors/DocumentationActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ class DocumentationActor(
import DocumentationActor._
import actors.{ DocumentationLoadingActor => Loader }

implicit val timeout: Timeout = Timeout(5.seconds)
implicit val system: ActorSystem[Nothing] = context.system
given timeout: Timeout = Timeout(5.seconds)
given system: ActorSystem[Nothing] = context.system
import system.executionContext

private def createRepo(config: TranslationConfig) = {
Expand Down
8 changes: 4 additions & 4 deletions app/actors/DocumentationPollingActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class DocumentationPollingActor(
// The version hasn't changed, don't rescan
case Some(same: TranslationVersion) if same.cacheId == newCacheId => same
case _ =>
implicit val lang = repos.default.config.lang
given lang: Lang = repos.default.config.lang

if (old.isDefined) {
log.info2("Updating default documentation for {}: {}", version, cacheId)
Expand Down Expand Up @@ -151,8 +151,8 @@ class DocumentationPollingActor(
).map(v => (v._1, v._2, v._1.name))
val mainVersion = determineMainVersion(t).map(v => (v._1, v._2, "main"))

implicit val lang = t.config.lang
val versions = versionsToTranslations(
given lang: Lang = t.config.lang
val versions = versionsToTranslations(
t.repo,
gitTags ++ gitBranches ++ mainVersion,
defaultTranslation,
Expand All @@ -179,7 +179,7 @@ class DocumentationPollingActor(
versions: Seq[(Version, ObjectId, String)],
aggregate: Translation,
old: Option[Translation],
)(implicit lang: Lang): List[TranslationVersion] = {
)(using lang: Lang): List[TranslationVersion] = {
versions
.sortBy(_._1)
.reverse
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Application @Inject() (
exampleProjectsService: PlayExampleProjectsService,
components: ControllerComponents,
cacheApi: SyncCacheApi,
)(implicit ec: ExecutionContext, val reverseRouter: _root_.controllers.documentation.ReverseRouter)
)(using ec: ExecutionContext, val reverseRouter: _root_.controllers.documentation.ReverseRouter)
extends AbstractController(components)
with Common
with I18nSupport {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/Blog.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import scala.concurrent.Future
@Singleton
class Blog @Inject() (
components: ControllerComponents,
)(implicit ec: ExecutionContext, val reverseRouter: _root_.controllers.documentation.ReverseRouter)
)(using ec: ExecutionContext, val reverseRouter: _root_.controllers.documentation.ReverseRouter)
extends AbstractController(components)
with Common
with I18nSupport {
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import play.api.mvc._
import play.api.mvc.Results._

trait Common {
def notFound(implicit request: RequestHeader) = NotFound(views.html.notfound())
def notFound(using request: RequestHeader) = NotFound(views.html.notfound())

implicit def reverseRouter: documentation.ReverseRouter
given reverseRouter: documentation.ReverseRouter
}
4 changes: 2 additions & 2 deletions app/controllers/Modules.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import scala.concurrent.Future

@Singleton
class Modules @Inject() (modulesLookup: ModulesLookup, moduleDao: ModuleDao, components: ControllerComponents)(
implicit
using
ec: ExecutionContext,
reverseRouter: documentation.ReverseRouter,
) extends AbstractController(components) {
Expand Down Expand Up @@ -77,5 +77,5 @@ class Modules @Inject() (modulesLookup: ModulesLookup, moduleDao: ModuleDao, com
}
}

private def PageNotFound(implicit request: RequestHeader) = NotFound(views.html.notfound())
private def PageNotFound(using request: RequestHeader) = NotFound(views.html.notfound())
}
2 changes: 1 addition & 1 deletion app/controllers/Outreachy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import scala.concurrent.Future
/**
* The outreachy controller
*/
class Outreachy @Inject() (components: ControllerComponents)(implicit
class Outreachy @Inject() (components: ControllerComponents)(using
reverseRouter: documentation.ReverseRouter,
) extends AbstractController(components) {

Expand Down
14 changes: 7 additions & 7 deletions app/controllers/documentation/DocumentationController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ class DocumentationController @Inject() (
documentationActor: ActorRef[Command],
releases: PlayReleases,
components: ControllerComponents,
)(implicit actorSystem: org.apache.pekko.actor.ActorSystem, reverseRouter: ReverseRouter)
)(using actorSystem: org.apache.pekko.actor.ActorSystem, reverseRouter: ReverseRouter)
extends AbstractController(components) {

private implicit val timeout: Timeout = Timeout(10.seconds)
private implicit val typedSystem: ActorSystem[Nothing] = actorSystem.toTyped
private given timeout: Timeout = Timeout(10.seconds)
private given typedSystem: ActorSystem[Nothing] = actorSystem.toTyped
import typedSystem.executionContext

private val Rfc1123DateTimeFormat = DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss 'GMT'").withZoneUTC()

private val EmptyContext = TranslationContext(Lang("en"), true, None, Nil, Nil)

private def pageNotFound(context: TranslationContext, title: String, alternateVersions: Seq[Version])(implicit
private def pageNotFound(context: TranslationContext, title: String, alternateVersions: Seq[Version])(using
req: RequestHeader,
) =
NotFound(views.html.documentation.v2(messages, context, title, alternateVersions = alternateVersions))
Expand Down Expand Up @@ -81,7 +81,7 @@ class DocumentationController @Inject() (
}
}

private def preferredLang(langs: Seq[Lang])(implicit request: RequestHeader) = {
private def preferredLang(langs: Seq[Lang])(using request: RequestHeader) = {
val maybeLangFromCookie = request.cookies.get(messages.langCookieName).flatMap(c => Lang.get(c.value))
val candidateLangs = maybeLangFromCookie match {
case Some(cookieLang) => cookieLang +: request.acceptLanguages
Expand All @@ -97,7 +97,7 @@ class DocumentationController @Inject() (
actor: ActorRef[Command],
page: String,
msg: ActorRef[Response[T]] => DocumentationActor.Request[T],
)(block: T => Result)(implicit req: RequestHeader): Future[Result] = {
)(block: T => Result)(using req: RequestHeader): Future[Result] = {
actor.ask[Response[T]](replyTo => msg(replyTo)).flatMap {
case DocsNotFound(context) =>
val future = Future.sequence(context.displayVersions.map(pageExists(_, page)))
Expand Down Expand Up @@ -371,7 +371,7 @@ class DocumentationController @Inject() (
}
}

def withLangHeaders(result: Result, page: String, context: TranslationContext)(implicit
def withLangHeaders(result: Result, page: String, context: TranslationContext)(using
req: RequestHeader,
) = {
val linkHeader = context.alternatives
Expand Down
6 changes: 3 additions & 3 deletions app/models/PlayExampleProjects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ case class TemplateParameter(
)

object TemplateParameter {
implicit val format: Format[TemplateParameter] = Json.format
given format: Format[TemplateParameter] = Json.format
}

case class ExampleProject(
Expand All @@ -42,7 +42,7 @@ case class ExampleProject(
}

object ExampleProject {
implicit val format: Format[ExampleProject] = Json.format
given format: Format[ExampleProject] = Json.format
}

class ExamplesModule extends AbstractModule {
Expand All @@ -57,7 +57,7 @@ class PlayExampleProjectsService @Inject() (
ws: WSClient,
cache: SyncCacheApi,
environment: Environment,
)(implicit ec: ExecutionContext) {
)(using ec: ExecutionContext) {

val validPlayVersions: Seq[String] = configuration.get[Seq[String]]("examples.playVersions")

Expand Down
4 changes: 2 additions & 2 deletions app/models/Releases.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ case class PlayRelease(
}

object PlayRelease {
implicit val releaseReads: Reads[PlayRelease] = Json.reads[PlayRelease]
given releaseReads: Reads[PlayRelease] = Json.reads[PlayRelease]
}

case class PlayReleases(
Expand All @@ -25,7 +25,7 @@ case class PlayReleases(
)

object PlayReleases {
implicit val playReleasesReads: Reads[PlayReleases] = Json.reads[PlayReleases]
given playReleasesReads: Reads[PlayReleases] = Json.reads[PlayReleases]
}

private[models] object SecurifyUrl {
Expand Down
8 changes: 4 additions & 4 deletions app/models/github/GitHub.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ case class Team(id: Long, name: String, url: String, members_url: String) {
}

object Team {
implicit val jsonReads: Reads[Team] = Json.reads[Team]
given jsonReads: Reads[Team] = Json.reads[Team]
}

/**
Expand All @@ -37,7 +37,7 @@ case class GitHubUser(
}

object GitHubUser {
implicit val jsonReads: Reads[GitHubUser] = Json.reads[GitHubUser]
given jsonReads: Reads[GitHubUser] = Json.reads[GitHubUser]
}

case class Repository(id: Long, name: String, full_name: String, fork: Boolean, contributors_url: String) {
Expand All @@ -46,7 +46,7 @@ case class Repository(id: Long, name: String, full_name: String, fork: Boolean,
}

object Repository {
implicit val jsonReads: Reads[Repository] = Json.reads[Repository]
given jsonReads: Reads[Repository] = Json.reads[Repository]
}

case class Organisation(id: Long, login: String, url: String, repos_url: String, members_url: String) {
Expand All @@ -55,5 +55,5 @@ case class Organisation(id: Long, login: String, url: String, repos_url: String,
}

object Organisation {
implicit val jsonReads: Reads[Organisation] = Json.reads[Organisation]
given jsonReads: Reads[Organisation] = Json.reads[Organisation]
}
6 changes: 3 additions & 3 deletions app/models/modules/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ case class Module(
)

object Module {
implicit val modulesWrites: Writes[Seq[(Module, Seq[Release])]] = {
given modulesWrites: Writes[Seq[(Module, Seq[Release])]] = {

implicit val releaseWrites: Writes[Release] = (
given releaseWrites: Writes[Release] = (
(__ \ "isDefault").write[Boolean] ~
(__ \ "version").write[String] ~
(__ \ "matches").write[String]
).apply(r => (r.isDefault, r.version, r.frameworkMatch))

implicit val moduleWrites: Writes[(Module, Seq[Release])] = (
given moduleWrites: Writes[(Module, Seq[Release])] = (
(__ \ "name").write[String] ~
(__ \ "fullname").write[String] ~
(__ \ "versions").write[Seq[Release]]
Expand Down
2 changes: 1 addition & 1 deletion app/models/opencollective/OpenCollective.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ case class OpenCollectiveMember(
}

object OpenCollectiveMember {
implicit val jsonReads: Reads[OpenCollectiveMember] = Json.reads[OpenCollectiveMember]
given jsonReads: Reads[OpenCollectiveMember] = Json.reads[OpenCollectiveMember]
}
4 changes: 2 additions & 2 deletions app/services/github/ContributorsSummariser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait ContributorsSummariser {
def fetchContributors: Future[Contributors]
}

class DefaultContributorsSummariser @Inject() (gitHub: GitHub, config: GitHubConfig)(implicit
class DefaultContributorsSummariser @Inject() (gitHub: GitHub, config: GitHubConfig)(using
ec: ExecutionContext,
) extends ContributorsSummariser {

Expand Down Expand Up @@ -93,7 +93,7 @@ class DefaultContributorsSummariser @Inject() (gitHub: GitHub, config: GitHubCon
class CachingContributorsSummariser @Inject() (
actorSystem: ActorSystem,
@Named("gitHubContributorsSummariser") delegate: ContributorsSummariser,
)(implicit ec: ExecutionContext)
)(using ec: ExecutionContext)
extends ContributorsSummariser {
private val log = LoggerFactory.getLogger(classOf[CachingContributorsSummariser])

Expand Down
3 changes: 1 addition & 2 deletions app/services/github/GitHub.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ case class GitHubConfig(
committerTeams: Seq[String],
)

class DefaultGitHub @Inject() (ws: WSClient, config: GitHubConfig)(implicit ec: ExecutionContext)
extends GitHub {
class DefaultGitHub @Inject() (ws: WSClient, config: GitHubConfig)(using ec: ExecutionContext) extends GitHub {

private def authCall(url: String) = {
ws.url(url).withHttpHeaders(HeaderNames.AUTHORIZATION -> ("token " + config.accessToken))
Expand Down
4 changes: 2 additions & 2 deletions app/services/opencollective/MembersSummariser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait MembersSummariser {
def fetchMembers: Future[Seq[OpenCollectiveMember]]
}

class DefaultMembersSummariser @Inject() (openCollective: OpenCollective)(implicit
class DefaultMembersSummariser @Inject() (openCollective: OpenCollective)(using
ec: ExecutionContext,
) extends MembersSummariser {

Expand All @@ -42,7 +42,7 @@ class DefaultMembersSummariser @Inject() (openCollective: OpenCollective)(implic
class CachingMembersSummariser @Inject() (
actorSystem: ActorSystem,
@Named("openCollectiveMembersSummariser") delegate: MembersSummariser,
)(implicit ec: ExecutionContext)
)(using ec: ExecutionContext)
extends MembersSummariser {
private val log = LoggerFactory.getLogger(classOf[CachingMembersSummariser])

Expand Down
2 changes: 1 addition & 1 deletion app/services/opencollective/OpenCollective.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ trait OpenCollective {

}

class DefaultOpenCollective @Inject() (ws: WSClient, config: OpenCollectiveConfig)(implicit
class DefaultOpenCollective @Inject() (ws: WSClient, config: OpenCollectiveConfig)(using
ec: ExecutionContext,
) extends OpenCollective {

Expand Down
2 changes: 1 addition & 1 deletion app/views/allreleases.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(releases: PlayReleases, platform: Platform.Platform, title: String = "Play Releases")(implicit requestHeader: RequestHeader, reverseRouter: ReverseRouter)
@(releases: PlayReleases, platform: Platform.Platform, title: String = "Play Releases")(using requestHeader: RequestHeader, reverseRouter: ReverseRouter)

@renderRelease(linkClass: String, release: PlayRelease) = {
@if(release.secureUrl) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/blog/graal.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(blogName:String, title: String)(implicit req: RequestHeader, reverseRouter: ReverseRouter)
@(blogName:String, title: String)(using req: RequestHeader, reverseRouter: ReverseRouter)
@main(title, blogName){
<header id="top">
<div class="wrapper">
Expand Down
2 changes: 1 addition & 1 deletion app/views/blog/index.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(title: String)(implicit req: RequestHeader, reverseRouter: ReverseRouter)
@(title: String)(using req: RequestHeader, reverseRouter: ReverseRouter)
@main(title, "blog"){
<header id="top">
<div class="wrapper">
Expand Down
2 changes: 1 addition & 1 deletion app/views/blog/ossPledgeLaunch.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(blogName:String,title: String)(implicit req: RequestHeader, reverseRouter: ReverseRouter)
@(blogName:String,title: String)(using req: RequestHeader, reverseRouter: ReverseRouter)
@main( title, blogName){
<header id="top">
<div class="wrapper">
Expand Down
4 changes: 2 additions & 2 deletions app/views/blog/socketio.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(blogName:String,title: String)(implicit req: RequestHeader, reverseRouter: ReverseRouter)
@(blogName:String,title: String)(using req: RequestHeader, reverseRouter: ReverseRouter)
@main( title, blogName){
<header id="top">
<div class="wrapper">
Expand Down Expand Up @@ -32,7 +32,7 @@ <h2 id="example-code">Example code</h2>
import play<span class="hljs-selector-class">.engineio</span><span class="hljs-selector-class">.EngineIOController</span>
import play<span class="hljs-selector-class">.socketio</span><span class="hljs-selector-class">.scaladsl</span><span class="hljs-selector-class">.SocketIO</span>

class ChatEngine(socketIO: SocketIO)(implicit mat: Materializer) {
class ChatEngine(socketIO: SocketIO)(using mat: Materializer) {
import play<span class="hljs-selector-class">.socketio</span><span class="hljs-selector-class">.scaladsl</span><span class="hljs-selector-class">.SocketIOEventCodec</span>._

<span class="hljs-comment">// codec to encode/codec chat message events to/from strings</span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/changelog.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(markdown: Html)(implicit req: RequestHeader, reverseRouter: ReverseRouter)
@(markdown: Html)(using req: RequestHeader, reverseRouter: ReverseRouter)

@main("Play Change Log", "changelog"){
<header id="top">
Expand Down
2 changes: 1 addition & 1 deletion app/views/clipboard.scala.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@()(implicit request: RequestHeader)
@()(using request: RequestHeader)

<script type="text/javascript" charset="utf-8" src="@routes.Assets.versioned("lib/clipboard.js/clipboard.js")"></script>
@views.html.helper.script(Symbol("type") -> "text/javascript") {
Expand Down
2 changes: 1 addition & 1 deletion app/views/code.scala.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import models.github._
@import controllers.documentation.ReverseRouter
@(contributors: Contributors, title: String = "Code & contributors")(implicit req: RequestHeader, reverseRouter: ReverseRouter)
@(contributors: Contributors, title: String = "Code & contributors")(using req: RequestHeader, reverseRouter: ReverseRouter)

@avatar(url: String, size: Int) = @{
val doubleSize = size * 2
Expand Down
2 changes: 1 addition & 1 deletion app/views/commonSidebar.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import controllers.documentation.ReverseRouter
@(hn: String = "h3")(implicit reverseRouter: ReverseRouter)
@(hn: String = "h3")(using reverseRouter: ReverseRouter)

<@hn>Documentation</@hn>
<ul>
Expand Down
Loading
Loading