Skip to content

Commit

Permalink
apply styleci
Browse files Browse the repository at this point in the history
  • Loading branch information
norbybaru committed Oct 4, 2023
1 parent 88eaf33 commit 8c71fa8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/Builder/CommonPayloadBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public function setCommonMeasureValueType(ValueTypeEnum $type): self
public function setCommonTime(Carbon $time): self
{
$this->commonAttributes['Time'] = $this->getPreciseTime($time);

return $this;
}

public function setCommonVersion(int $version): self
{
$this->commonAttributes['Version'] = $version;

return $this;
}

Expand All @@ -52,7 +52,7 @@ public function toArray(): array
$common = [];
if ($this->commonDimensions) {
$common = [
'Dimensions' => $this->commonDimensions
'Dimensions' => $this->commonDimensions,
];
}

Expand All @@ -66,4 +66,4 @@ private function getPreciseTime(Carbon $time): string
{
return (string) $time->getPreciseTimestamp(3);
}
}
}
2 changes: 1 addition & 1 deletion src/Builder/PayloadBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function setMultiMeasuresValues(string $name, mixed $value, ValueTypeEnum
$this->measureValues[] = [
'Name' => $name,
'Value' => $value,
'Type' => $type->value
'Type' => $type->value,

Check failure on line 78 in src/Builder/PayloadBuilder.php

View workflow job for this annotation

GitHub Actions / phpstan

Access to property $value on an unknown class NorbyBaru\AwsTimestream\Enum\ValueTypeEnum.
];

return $this;
Expand Down
2 changes: 0 additions & 2 deletions src/Contract/PayloadBuilderContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace NorbyBaru\AwsTimestream\Contract;

use Illuminate\Support\Carbon;

interface PayloadBuilderContract
{
public static function make(string $measureName): self;
Expand Down
1 change: 1 addition & 0 deletions src/TimestreamService.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private function runQuery(array $params): Collection
if ($nextToken = $result->get('NextToken')) {
$parsedRows = $this->parseQueryResult($result);
$params['NextToken'] = $nextToken;

return $this->runQuery($params)->merge($parsedRows);
}
} catch (TimestreamQueryException $e) {
Expand Down
2 changes: 1 addition & 1 deletion src/enum/ValueTypeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ enum ValueTypeEnum: string
case VARCHAR = 'VARCHAR';
case BOOLEAN = 'BOOLEAN';
case TIMESTAMP = 'TIMESTAMP';
}
}
9 changes: 1 addition & 8 deletions tests/Feature/PayloadWriterFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class PayloadWriterFeatureTest extends TestCase
{
/**
* Writing of Multi-measure attributes
*
* @return void
*/
public function test_it_should_ingest_multi_measure_records()
{
Expand All @@ -38,7 +36,7 @@ public function test_it_should_ingest_multi_measure_records()
$payload->setTime(Carbon::now()->subMilliseconds($index * 50));
$records = [
...$records,
...$payload->toArray()
...$payload->toArray(),
];

if (count($records) === 100) {
Expand All @@ -53,11 +51,8 @@ public function test_it_should_ingest_multi_measure_records()
}
}


/**
* Writing of single record attributes
*
* @return void
*/
public function test_it_should_ingest_single_measure_record()
{
Expand All @@ -78,8 +73,6 @@ public function test_it_should_ingest_single_measure_record()

/**
* Writing batches of records with common attributes
*
* @return void
*/
public function test_it_should_batch_ingest_data()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/ReaderFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace NorbyBaru\AwsTimestream\Tests\Feature;

use NorbyBaru\AwsTimestream\Dto\TimestreamReaderDto;
use NorbyBaru\AwsTimestream\Tests\TestCase;
use NorbyBaru\AwsTimestream\TimestreamBuilder;
use NorbyBaru\AwsTimestream\TimestreamService;
use NorbyBaru\AwsTimestream\Dto\TimestreamReaderDto;

class ReaderFeatureTest extends TestCase
{
Expand All @@ -18,7 +18,7 @@ public function test_it_should_return_results()
->orderBy('time', 'desc');

$reader = TimestreamReaderDto::make($queryBuilder);

/** @var TimestreamService */
$timestreamService = app(TimestreamService::class);
$result = $timestreamService->query($reader);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function getPackageProviders($app)
TimestreamServiceProvider::class,
];
}

/**
* @param string $filePath
*
Expand Down

0 comments on commit 8c71fa8

Please sign in to comment.