diff --git a/src/App/Entity/Activity.php b/src/App/Entity/Activity.php index 7c352a7..3f841f4 100644 --- a/src/App/Entity/Activity.php +++ b/src/App/Entity/Activity.php @@ -194,7 +194,7 @@ class Activity implements \JsonSerializable */ public function addComment(Comment $comment): Activity { - if(!$this->comments->contains($comment)) { + if (!$this->comments->contains($comment)) { $this->comments->add($comment); } return $this; @@ -206,7 +206,7 @@ class Activity implements \JsonSerializable */ public function removeComment(Comment $comment): Activity { - if($this->comments->contains($comment)) { + if ($this->comments->contains($comment)) { $this->comments->removeElement($comment); } return $this; diff --git a/src/App/Entity/News.php b/src/App/Entity/News.php index e523bc4..5e47f51 100644 --- a/src/App/Entity/News.php +++ b/src/App/Entity/News.php @@ -5,4 +5,4 @@ namespace App\Entity; class News { -} \ No newline at end of file +} diff --git a/src/App/Entity/User.php b/src/App/Entity/User.php index f1ddede..ebb5bbb 100644 --- a/src/App/Entity/User.php +++ b/src/App/Entity/User.php @@ -64,4 +64,4 @@ class User implements \JsonSerializable 'displayName' => $this->getDisplayName(), ]; } -} \ No newline at end of file +} diff --git a/src/App/Service/SkiesClientService.php b/src/App/Service/SkiesClientService.php index af65287..f6afa05 100644 --- a/src/App/Service/SkiesClientService.php +++ b/src/App/Service/SkiesClientService.php @@ -8,10 +8,8 @@ use App\Entity\User; use GuzzleHttp\Client; use GuzzleHttp\Cookie\CookieJarInterface; use GuzzleHttp\Cookie\FileCookieJar; -use function GuzzleHttp\Psr7\parse_query; use Psr\Http\Message\ResponseInterface; use Ramsey\Uuid\Uuid; -use Zend\Diactoros\Uri; use Zend\Dom\Document; use Zend\Expressive\Exception\MissingDependencyException; @@ -40,8 +38,6 @@ class SkiesClientService /** @var CookieJarInterface */ private $cookieJar = null; - private $counter = 0; - /** * SkiesClientService constructor. * @param Client $client @@ -255,12 +251,12 @@ class SkiesClientService ->setDate(new \DateTime(sprintf("%s %s", $matches[1], $matches[2]))) ->setFinalEntry(new \DateTime($matches[3])) ->setAccountable(str_replace( - " ", - " ", - $matches[5] + " ", + " ", + $matches[5] ? sprintf("%s (%s)", $matches[4], $matches[5]) - : $matches[4]) - ) + : $matches[4] + )) ->setSignedUsers($signedUsers) ->setIsSignedup($isSignedUp) ->setCanChangeSignup($canChangeSignup); @@ -444,7 +440,6 @@ class SkiesClientService private function doSkiesRequest(string $method, string $url, $options = []): ResponseInterface { $this->getAuthCookies(); - $this->counter += 1; $response = $this->client ->request($method, $url, [ 'cookies' => $this->cookieJar,