Skip to content

Commit

Permalink
chore: improved code style
Browse files Browse the repository at this point in the history
  • Loading branch information
petrknap committed Apr 23, 2024
1 parent ee394f1 commit 9cc2162
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/CriticalSectionTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
<?php

declare(strict_types=1);

Expand Down
2 changes: 1 addition & 1 deletion tests/NonCriticalSectionTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
<?php

declare(strict_types=1);

Expand Down
4 changes: 3 additions & 1 deletion tests/ReadmeTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace PetrKnap\CriticalSection;

Expand Down
9 changes: 5 additions & 4 deletions tests/SymfonyLockCriticalSectionTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
<?php

declare(strict_types=1);

Expand All @@ -8,6 +8,7 @@
use PetrKnap\CriticalSection\Exception\CouldNotEnterCriticalSection;
use PetrKnap\CriticalSection\Exception\CouldNotLeaveCriticalSection;
use PHPUnit\Framework\TestCase;
use stdClass;
use Symfony\Component\Lock\Exception\LockAcquiringException;
use Symfony\Component\Lock\Exception\LockConflictedException;
use Symfony\Component\Lock\Exception\LockReleasingException;
Expand All @@ -17,7 +18,7 @@ final class SymfonyLockCriticalSectionTest extends TestCase
{
public function testAcquiresLockBeforeCriticalSectionIsExecuted(): void
{
$shared = new \stdClass();
$shared = new stdClass();
$shared->isLocked = false;
$lock = self::createMock(LockInterface::class);
$lock->expects(self::once())
Expand All @@ -34,7 +35,7 @@ public function testAcquiresLockBeforeCriticalSectionIsExecuted(): void

public function testReleasesLockAfterCriticalSectionWasExecuted(): void
{
$shared = new \stdClass();
$shared = new stdClass();
$shared->isLocked = true;
$lock = self::createMock(LockInterface::class);
$lock->method('acquire')->willReturn(true);
Expand All @@ -53,7 +54,7 @@ public function testReleasesLockAfterCriticalSectionWasExecuted(): void

public function testReleasesLockAndThrowsWhenCriticalSectionThrows(): void
{
$shared = new \stdClass();
$shared = new stdClass();
$shared->isLocked = true;
$lock = self::createMock(LockInterface::class);
$lock->method('acquire')->willReturn(true);
Expand Down
3 changes: 2 additions & 1 deletion tests/WrappingCriticalSectionTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @noinspection PhpUnhandledExceptionInspection */
<?php

declare(strict_types=1);

Expand All @@ -10,6 +10,7 @@
final class WrappingCriticalSectionTest extends TestCase
{
private const FOO = 'bar';

public function testReturnsValueReturnedByExecutedCriticalSection(): void
{
self::assertSame(
Expand Down

0 comments on commit 9cc2162

Please sign in to comment.