Skip to content

Commit e5b7f84

Browse files
committed
Fixing helper classes (except for mail notifications and stuff related to exercise/pipeline configs).
1 parent 7e811f4 commit e5b7f84

61 files changed

Lines changed: 164 additions & 176 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/commands/PlagiarismDetectionAccessToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(AccessManager $accessManager, Users $users)
3838
protected function configure()
3939
{
4040
$this->setName(self::$defaultName)
41-
->setDescription('Generate token restricted for plagiarsim scope (for 3rd party tools).');
41+
->setDescription('Generate token restricted for plagiarism scope (for 3rd party tools).');
4242
$this->addArgument('userId', InputArgument::REQUIRED, 'ID of the admin owning the token.');
4343
$this->addOption(
4444
'expiration',

app/config/config.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ parameters:
114114
exerciseUrl: "%webapp.address%/app/exercises/{id}"
115115
shadowAssignmentUrl: "%webapp.address%/app/shadow-assignment/{id}"
116116
solutionUrl: "%webapp.address%/app/assignment/{assignmentId}/solution/{solutionId}"
117-
referenceSolutiontUrl: "%webapp.address%/app/exercises/{exerciseId}/reference-solution/{solutionId}"
117+
referenceSolutionUrl: "%webapp.address%/app/exercises/{exerciseId}/reference-solution/{solutionId}"
118118
forgottenPasswordUrl: "%webapp.address%/forgotten-password/change?{token}" # URL of web application where the password can be changed
119119
emailVerificationUrl: "%webapp.address%/email-verification?{token}"
120120
invitationUrl: "%webapp.address%/accept-invitation?{token}"

app/helpers/AnnotationsParser.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
* This file is part of the Nette Framework (https://nette.org)
55
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
66
*
7-
* We have copied this form abanndoned Nette/Reflection module, so we can use the parse and extend it in the future.
7+
* We have copied this form abanndoned Nette/Reflection module, so we can use the parser and extend it in the future.
88
* For the original code, visit https://github.com/nette/reflection/blob/master/src/Reflection/AnnotationsParser.php
9+
*
10+
* News: After the great endpoint parameter specification refactoring, this may no longer be required.
911
*/
1012

1113
namespace App\Helpers;

app/helpers/AnonymizationHelper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Nette;
66
use Nette\Utils\Arrays;
7-
use App\Model\Entity\Login;
87
use App\Model\Entity\User;
98
use App\Model\Repository\Users;
109
use App\Model\Repository\Logins;
@@ -34,7 +33,7 @@ class AnonymizationHelper
3433
protected $anonymizedName;
3534

3635
/**
37-
* @var string Suffix appended to an email addres of deleted user.
36+
* @var string Suffix appended to an email address of deleted user.
3837
*/
3938
protected $deletedEmailSuffix;
4039

app/helpers/BasicAuthHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public static function getCredentials(IRequest $req)
2121
{
2222
$auth = $req->getHeader("Authorization");
2323
if ($auth === null || str_starts_with($auth, "Basic ") === false) {
24-
throw new HttpBasicAuthException("The request from backend-service must contain HTTP Basic authentication.");
24+
throw new HttpBasicAuthException(
25+
"The request from backend-service must contain HTTP Basic authentication."
26+
);
2527
}
2628

2729
$encodedCredentials = Strings::substring($auth, strlen("Basic "));

app/helpers/BrokerProxy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use App\Exceptions\SubmissionFailedException;
77
use ZMQ;
88
use ZMQContext;
9-
use ZMQException;
109
use ZMQPoll;
1110
use ZMQPollException;
1211
use ZMQSocket;
@@ -52,7 +51,7 @@ public function __construct(array $config)
5251

5352
/**
5453
* Start evaluation of new job. This means sending proper message to broker that we want this new
55-
* job to be evaluated, receive confirmation that the message was successfuly received and finally
54+
* job to be evaluated, receive confirmation that the message was successfully received and finally
5655
* receive confirmation if the evaluation can be processed or not (for example if there is worker
5756
* for that hwgroup available).
5857
* @param string $jobId Unique identifier of the new job

app/helpers/Emails/EmailLatteExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class EmailLatteExtension extends Latte\Extension
2222
private static $subject = null;
2323

2424
/**
25-
* Used both by the extension and to re-set the subjec before rendering.
25+
* Used both by the extension and to re-set the subject before rendering.
2626
* @param string|null $subject
2727
*/
2828
public static function setSubject(?string $subject): void

app/helpers/Emails/EmailLatteFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Helpers\Emails;
44

5-
use Latte;
65
use Latte\Engine;
76
use Latte\Essential\Filters;
87
use League\CommonMark\CommonMarkConverter;
@@ -13,7 +12,6 @@
1312
*/
1413
class EmailLatteFactory
1514
{
16-
1715
/**
1816
* Create latte engine for email templates with helper filters.
1917
* @return EmailLatteWrapper

app/helpers/Emails/EmailLatteWrapper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
class EmailLatteWrapper
1111
{
12-
1312
private $latte;
1413

1514
public function __construct(Engine $latte)

app/helpers/Emails/EmailLocalizationHelper.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,20 @@ function (User $user) {
121121
private static $localizations = [
122122
EmailLocalizationHelper::CZECH_LOCALE => [
123123
// this is actually not perfect, but it will do for now
124-
'y' => [ 1 => "rok", 2 => "roky", 5 => "let" ],
125-
'm' => [ 1 => "měsíc", 2 => "měsíce", 5 => "měsíců" ],
126-
'd' => [ 1 => "den", 2 => "dny", 5 => 'dní' ],
127-
'h' => [ 1 => "hodina", 2 => "hodiny", 5 => "hodin" ],
128-
'i' => [ 1 => "minuta", 2 => "minuty", 5 => "minut" ],
129-
's' => [ 1 => "vteřina", 2 => "vteřiny", 5 => "vteřin" ],
124+
'y' => [1 => "rok", 2 => "roky", 5 => "let"],
125+
'm' => [1 => "měsíc", 2 => "měsíce", 5 => "měsíců"],
126+
'd' => [1 => "den", 2 => "dny", 5 => 'dní'],
127+
'h' => [1 => "hodina", 2 => "hodiny", 5 => "hodin"],
128+
'i' => [1 => "minuta", 2 => "minuty", 5 => "minut"],
129+
's' => [1 => "vteřina", 2 => "vteřiny", 5 => "vteřin"],
130130
],
131131
EmailLocalizationHelper::DEFAULT_LOCALE => [ // default (English)
132-
'y' => [ 1 => "year", 2 => "years" ],
133-
'm' => [ 1 => "month", 2 => "months" ],
134-
'd' => [ 1 => "day", 2 => "days" ],
135-
'h' => [ 1 => "hour", 2 => "hours" ],
136-
'i' => [ 1 => "minute", 2 => "minutes" ],
137-
's' => [ 1 => "second", 2 => "seconds" ],
132+
'y' => [1 => "year", 2 => "years"],
133+
'm' => [1 => "month", 2 => "months"],
134+
'd' => [1 => "day", 2 => "days"],
135+
'h' => [1 => "hour", 2 => "hours"],
136+
'i' => [1 => "minute", 2 => "minutes"],
137+
's' => [1 => "second", 2 => "seconds"],
138138
]
139139
];
140140

@@ -158,7 +158,7 @@ private static function getDateIntervalLocalizationSuffix(int $value, array $suf
158158
/**
159159
* Return localized string with an informal description of relative time (date interval).
160160
* It writes out up to two the most significant values, so it is brief yet it scales from seconds to years.
161-
* The interval is treated as absoluted value (ignoring the sign).
161+
* The interval is treated as absolute value (ignoring the sign).
162162
* @param DateInterval $dateDiff interval to be displayed
163163
* @param string $locale identification of the language
164164
* @return string formatted relative time

0 commit comments

Comments
 (0)