Skip to content

Commit 97e7f7d

Browse files
committed
Use proper objects creation with parenthesis
1 parent cc4a34c commit 97e7f7d

File tree

140 files changed

+411
-411
lines changed

Some content is hidden

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

140 files changed

+411
-411
lines changed

app/V1Module/presenters/BrokerReportsPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function startup() {
7777
&& $password === $this->brokerConfig->getAuthPassword();
7878

7979
if (!$isAuthCorrect) {
80-
throw new WrongCredentialsException;
80+
throw new WrongCredentialsException();
8181
}
8282

8383
parent::startup();

app/V1Module/presenters/ExercisesConfigPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function actionUpdateEnvironmentConfigs(string $id) {
190190
throw new InvalidArgumentException("No entry for runtime configurations given.");
191191
}
192192

193-
$runtimeEnvironments = new ArrayCollection;
193+
$runtimeEnvironments = new ArrayCollection();
194194
// go through given configurations and construct database entities
195195
foreach ($environmentConfigs as $environmentConfig) {
196196
$environmentId = $environmentConfig["runtimeEnvironmentId"];

app/V1Module/presenters/ForgottenPasswordPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function actionValidatePasswordStrength() {
8383
$req = $this->getHttpRequest();
8484
$password = $req->getPost("password");
8585

86-
$zxcvbn = new Zxcvbn;
86+
$zxcvbn = new Zxcvbn();
8787
$passwordStrength = $zxcvbn->passwordStrength($password);
8888
$this->sendSuccessResponse([
8989
"passwordScore" => $passwordStrength["score"]

app/V1Module/presenters/RegistrationPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function actionValidateRegistrationData() {
188188
$password = $req->getPost("password");
189189

190190
$user = $this->users->getByEmail($email);
191-
$zxcvbn = new Zxcvbn;
191+
$zxcvbn = new Zxcvbn();
192192
$passwordStrength = $zxcvbn->passwordStrength($password, [ $email, $emailParts[0] ]);
193193

194194
$this->sendSuccessResponse([

app/V1Module/presenters/base/BasePresenter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ protected function formatPermissionCheckMethod($action) {
7979
public function startup() {
8080
parent::startup();
8181
$this->application->errorPresenter = "V1:ApiError";
82-
$this->parameters = new \stdClass;
82+
$this->parameters = new \stdClass();
8383

8484
try {
8585
$presenterReflection = new Reflection\ClassType(get_class($this));
8686
$actionMethodName = $this->formatActionMethod($this->getAction());
8787
$actionReflection = $presenterReflection->getMethod($actionMethodName);
8888
} catch (ReflectionException $e) {
89-
throw new NotImplementedException;
89+
throw new NotImplementedException();
9090
}
9191

9292
$this->tryCall($this->formatPermissionCheckMethod($this->getAction()), $this->params);

app/V1Module/security/AccessManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getUser(AccessToken $token): User {
9595
/** @var User $user */
9696
$user = $this->users->get($token->getUserId());
9797
if (!$user || $user->isAllowed() === false) {
98-
throw new ForbiddenRequestException;
98+
throw new ForbiddenRequestException();
9999
}
100100

101101
return $user;

app/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require __DIR__ . '/../vendor/autoload.php';
44

5-
$configurator = new Nette\Configurator;
5+
$configurator = new Nette\Configurator();
66

77
$configurator->enableDebugger(__DIR__ . '/../log');
88
// $configurator->setDebugMode(false);

app/helpers/BrokerProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function startEvaluation(string $jobId, array $hardwareGroups, array $hea
6363
$poll = null;
6464

6565
try {
66-
$queue = new ZMQSocket(new ZMQContext, ZMQ::SOCKET_DEALER, $jobId);
66+
$queue = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_DEALER, $jobId);
6767
// Configure socket to not wait at close time
6868
$queue->setsockopt(ZMQ::SOCKOPT_LINGER, 0);
6969
$queue->connect($this->brokerAddress);

app/helpers/Emails/EmailHelper/EmailHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function send(?string $from, array $to, string $subject, string $text, ar
7878
$from = $this->from;
7979
}
8080

81-
$latte = new Latte\Engine;
81+
$latte = new Latte\Engine();
8282
$params = [
8383
"subject" => $subject,
8484
"message" => $text,
@@ -89,7 +89,7 @@ public function send(?string $from, array $to, string $subject, string $text, ar
8989
];
9090
$html = $latte->renderToString(__DIR__ . "/email.latte", $params);
9191

92-
$message = new Message;
92+
$message = new Message();
9393
$message->setFrom($from)
9494
->setSubject($subject)
9595
->setHtmlBody($html);

app/helpers/Emails/EmailVerificationHelper/EmailVerificationHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ private function createSubject(User $user): string {
138138
private function createBody(User $user, string $token): string {
139139
// show to user a minute less, so he doesn't waste time ;-)
140140
$exp = $this->tokenExpiration - 60;
141-
$expiresAfter = (new DateTime)->add(new DateInterval("PT{$exp}S"));
141+
$expiresAfter = (new DateTime())->add(new DateInterval("PT{$exp}S"));
142142

143143
// render the HTML to string using Latte engine
144-
$latte = new Latte\Engine;
144+
$latte = new Latte\Engine();
145145
return $latte->renderToString(__DIR__ . "/verificationEmail.latte", [
146146
"email" => $user->getEmail(),
147147
"link" => "{$this->redirectUrl}#{$token}",

0 commit comments

Comments
 (0)