Skip to content

Commit

Permalink
phpstan & psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
fiste788 committed Apr 5, 2024
1 parent 3db00ce commit 668a2aa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Service/DownloadRatingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ private function downloadRatings(
?string $url = null
): ?string {
$url = $url ?? $this->getRatingsFile($matchdayGazzetta);
if ($url != null && $url != '') {
if ($url != null) {
$content = $this->decryptMXMFile($matchday, $url);
if ($content != null && empty($content) == false && strlen($content) > 42000) {
if ($content != null && strlen($content) > 42000) {
$this->writeCsvRatings($content, $path);
//self::writeXmlVoti($content, $percorsoXml);
return $path;
Expand Down Expand Up @@ -135,7 +135,7 @@ public function decryptMXMFile(Matchday $matchday, ?string $path = null): ?strin
$explode_xor = explode('-', $decrypt);
$i = 0;
$content = file_get_contents($path);
if (!empty($content)) {
if ($content !== false && !empty($content)) {
while (!feof($p_file)) {
if ($i == count($explode_xor)) {
$i = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Service/RatingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ public function importRatings(Matchday $matchday, ?string $path = null): bool
}

if (
!$ratingsTable->saveMany($ratings, [
$ratingsTable->saveMany($ratings, [
'checkExisting' => false,
'associated' => false,
'checkRules' => false,
])
]) == false
) {
foreach ($ratings as $value) {
if (!empty($value->getErrors()) && $this->io != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Service/UpdateMemberService.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function updateMembers(Matchday $matchday, ?string $path = null): void
if ($this->io != null) {
$this->io->out('Savings ' . count($membersToSave) . ' members');
}
if (!$membersTable->saveMany($membersToSave)) {
if ($membersTable->saveMany($membersToSave) == false) {
$ev = new Event('Fantamanajer.memberTransferts', $this, [
'sells' => $sells,
'buys' => $buys,
Expand Down
3 changes: 0 additions & 3 deletions src/Service/WebauthnService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Cake\Core\Configure;
use Cake\Http\Client;
use Cake\I18n\DateTime;
use Cake\Log\Log;
use Cake\ORM\Locator\LocatorAwareTrait;
use Cake\Utility\Hash;
use Cose\Algorithm\Manager;
Expand Down Expand Up @@ -300,7 +299,6 @@ public function signin(

// Load the data
$body = $request->getBody()->__toString();
Log::info($body);
$publicKeyCredential = $this->serializer->deserialize(
$body,
PublicKeyCredential::class,
Expand Down Expand Up @@ -414,7 +412,6 @@ public function registerResponse(ServerRequestInterface $request): ?EntityPublic

// Load the data
$body = $request->getBody()->__toString();
Log::info($body);
$publicKeyCredential = $this->serializer->deserialize(
$body,
PublicKeyCredential::class,
Expand Down

0 comments on commit 668a2aa

Please sign in to comment.