| @@ 326-337 (lines=12) @@ | ||
| 323 | * @param string $username |
|
| 324 | * @return JsonResponse |
|
| 325 | */ |
|
| 326 | public function pairDataApiAction(Request $request, $project, $username) |
|
| 327 | { |
|
| 328 | $ret = $this->setUpEditCounter($project, $username); |
|
| 329 | if ($ret instanceof RedirectResponse) { |
|
| 330 | return $ret; |
|
| 331 | } |
|
| 332 | ||
| 333 | return new JsonResponse( |
|
| 334 | $this->editCounter->getPairData(), |
|
| 335 | Response::HTTP_OK |
|
| 336 | ); |
|
| 337 | } |
|
| 338 | ||
| 339 | /** |
|
| 340 | * Get various log counts for the user as JSON. |
|
| @@ 347-358 (lines=12) @@ | ||
| 344 | * @param string $username |
|
| 345 | * @return JsonResponse |
|
| 346 | */ |
|
| 347 | public function logCountsApiAction(Request $request, $project, $username) |
|
| 348 | { |
|
| 349 | $ret = $this->setUpEditCounter($project, $username); |
|
| 350 | if ($ret instanceof RedirectResponse) { |
|
| 351 | return $ret; |
|
| 352 | } |
|
| 353 | ||
| 354 | return new JsonResponse( |
|
| 355 | $this->editCounter->getLogCounts(), |
|
| 356 | Response::HTTP_OK |
|
| 357 | ); |
|
| 358 | } |
|
| 359 | ||
| 360 | /** |
|
| 361 | * Get edit sizes for the user as JSON. |
|
| @@ 368-379 (lines=12) @@ | ||
| 365 | * @param string $username |
|
| 366 | * @return JsonResponse |
|
| 367 | */ |
|
| 368 | public function editSizesApiAction(Request $request, $project, $username) |
|
| 369 | { |
|
| 370 | $ret = $this->setUpEditCounter($project, $username); |
|
| 371 | if ($ret instanceof RedirectResponse) { |
|
| 372 | return $ret; |
|
| 373 | } |
|
| 374 | ||
| 375 | return new JsonResponse( |
|
| 376 | $this->editCounter->getEditSizeData(), |
|
| 377 | Response::HTTP_OK |
|
| 378 | ); |
|
| 379 | } |
|
| 380 | ||
| 381 | /** |
|
| 382 | * Get the namespace totals for the user as JSON. |
|
| @@ 389-400 (lines=12) @@ | ||
| 386 | * @param string $username |
|
| 387 | * @return Response |
|
| 388 | */ |
|
| 389 | public function namespaceTotalsApiAction(Request $request, $project, $username) |
|
| 390 | { |
|
| 391 | $ret = $this->setUpEditCounter($project, $username); |
|
| 392 | if ($ret instanceof RedirectResponse) { |
|
| 393 | return $ret; |
|
| 394 | } |
|
| 395 | ||
| 396 | return new JsonResponse( |
|
| 397 | $this->editCounter->namespaceTotals(), |
|
| 398 | Response::HTTP_OK |
|
| 399 | ); |
|
| 400 | } |
|
| 401 | ||
| 402 | /** |
|
| 403 | * Display or fetch the month counts for the user. |
|
| @@ 410-421 (lines=12) @@ | ||
| 407 | * @param string $username |
|
| 408 | * @return Response |
|
| 409 | */ |
|
| 410 | public function monthcountsApiAction(Request $request, $project, $username) |
|
| 411 | { |
|
| 412 | $ret = $this->setUpEditCounter($project, $username); |
|
| 413 | if ($ret instanceof RedirectResponse) { |
|
| 414 | return $ret; |
|
| 415 | } |
|
| 416 | ||
| 417 | return new JsonResponse( |
|
| 418 | $this->editCounter->monthCounts(), |
|
| 419 | Response::HTTP_OK |
|
| 420 | ); |
|
| 421 | } |
|
| 422 | } |
|
| 423 | ||