Skip to content

Support Laravel 12.x and PHP 8.4 #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
strategy:
matrix:
include:
- php: 8.4
illuminate: ^12.0
- php: 8.3
illuminate: ^11.0
- php: 8.2
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"ci-test": "vendor/bin/phpunit --coverage-clover coverage.xml"
},
"require": {
"php": "^7.3|^7.4|^8.0|^8.1|^8.2|^8.3",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/container": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/hashing": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"php": "^7.3|^7.4|^8.0|^8.1|^8.2|^8.3|^8.4",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"illuminate/container": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"illuminate/hashing": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"aws/aws-sdk-php": "^3.0"
},
"require-dev": {
"illuminate/auth": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/auth": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"symfony/var-dumper": "^5.0|^6.0|^7.0",
"vlucas/phpdotenv": "^4.1|^5.0",
"mockery/mockery": "^1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/Kitar/Dynamodb/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function getDefaultPostProcessor()
*/
protected function getDefaultQueryGrammar()
{
return $this->withTablePrefix(new Query\Grammar());
return new Query\Grammar();
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/Kitar/Dynamodb/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ public function newQuery()
*/
protected function process($query_method, $processor_method)
{
$table_name = $this->connection->getTablePrefix() . $this->from;

// Compile columns and wheres attributes.
// These attributes needs to interact with ExpressionAttributes during compile,
// so it need to run before compileExpressionAttributes.
Expand All @@ -590,13 +592,13 @@ protected function process($query_method, $processor_method)
// Compile rest of attributes.
$params = array_merge(
$params,
$this->grammar->compileTableName($this->from),
$this->grammar->compileTableName($table_name),
$this->grammar->compileIndexName($this->index),
$this->grammar->compileKey($this->key),
$this->grammar->compileItem($this->item),
$this->grammar->compileUpdates($this->updates),
$this->grammar->compileBatchGetRequestItems($this->from, $this->batch_get_keys),
$this->grammar->compileBatchWriteRequestItems($this->from, $this->batch_write_request_items),
$this->grammar->compileBatchGetRequestItems($table_name, $this->batch_get_keys),
$this->grammar->compileBatchWriteRequestItems($table_name, $this->batch_write_request_items),
$this->grammar->compileDynamodbLimit($this->limit),
$this->grammar->compileScanIndexForward($this->scan_index_forward),
$this->grammar->compileExclusiveStartKey($this->exclusive_start_key),
Expand Down
6 changes: 1 addition & 5 deletions src/Kitar/Dynamodb/Query/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct()
public function compileTableName($table_name)
{
return [
'TableName' => $this->tablePrefix . $table_name
'TableName' => $table_name
];
}

Expand Down Expand Up @@ -146,8 +146,6 @@ public function compileBatchGetRequestItems($table_name, $keys)
return $marshaler->marshalItem($key);
})->toArray();

$table_name = $this->tablePrefix . $table_name;

return [
'RequestItems' => [
$table_name => [
Expand All @@ -174,8 +172,6 @@ public function compileBatchWriteRequestItems($table_name, $request_items)
});
})->toArray();

$table_name = $this->tablePrefix . $table_name;

return [
'RequestItems' => [
$table_name => $marshaled_items,
Expand Down
2 changes: 2 additions & 0 deletions tests/Query/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,7 @@ public function it_can_process_scan_with_columns_specified()
public function it_can_process_process()
{
$connection = m::mock(Connection::class);
$connection->shouldReceive('getTablePrefix');
$connection->shouldReceive('scan')
->with(['TableName' => 'Forum'])
->andReturn(new Result(['Items' => []]))
Expand All @@ -1179,6 +1180,7 @@ public function it_can_process_process()
public function it_can_process_process_with_no_processor()
{
$connection = m::mock(Connection::class);
$connection->shouldReceive('getTablePrefix');
$connection->shouldReceive('putItem')
->with([
'TableName' => 'Thread',
Expand Down