Skip to content

Commit

Permalink
Converting docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbrink committed Apr 15, 2024
1 parent e10b311 commit 9de7611
Show file tree
Hide file tree
Showing 19 changed files with 206 additions and 92 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"require-dev": {
"phpunit/phpunit": "^10.0",
"spatie/ray": "^1.30",
"laravel/pint": "^1.10"
"laravel/pint": "^1.10",
"rector/rector": "^1.0"
}
}
123 changes: 122 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use Rector\Config\RectorConfig;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector;

return RectorConfig::configure()
->withRules([
CoversAnnotationWithValueToAttributeRector::class,
]);
12 changes: 4 additions & 8 deletions tests/Unit/AmznSPAConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
use Jasara\AmznSPA\DataTransferObjects\GrantlessTokenDTO;
use Jasara\AmznSPA\DataTransferObjects\RestrictedDataTokenDTO;
use Jasara\AmznSPA\Exceptions\AuthenticationException;
use PHPUnit\Framework\Attributes\CoversClass;
use Psr\Log\LogLevel;
use Symfony\Component\HttpKernel\Log\Logger;

/**
* @covers \Jasara\AmznSPA\AmznSPAConfig
*/
#[CoversClass(AmznSPAConfig::class)]
class AmznSPAConfigTest extends UnitTestCase
{
public function testGetNewConfig()
Expand Down Expand Up @@ -157,21 +156,18 @@ public function testSetters()
$this->assertFalse($config->shouldGetRdtTokens());
}

/**
* @covers \Jasara\AmznSPA\AmznSPAConfig
*/
public function testLogger()
{
$config = $this->setupMinimalConfig();

$error_filepath = __DIR__ . '/../error-log.txt';
$error_filepath = __DIR__.'/../error-log.txt';
touch($error_filepath);
$logger_resource = fopen($error_filepath, 'rw+');
ftruncate($logger_resource, 0);
$logger = new Logger(LogLevel::DEBUG, $logger_resource, function (string $level, string $message, array $context) {
$log = sprintf('[%s] %s', $level, $message);
if (count($context)) {
$log .= ' Context: ' . json_encode($context);
$log .= ' Context: '.json_encode($context);
}

$log = str_replace(["\n", "\r"], '', $log);
Expand Down
Loading

0 comments on commit 9de7611

Please sign in to comment.