Skip to content

Commit

Permalink
Fix deprecation notices due to dynamic properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jankonas authored and JiriLojda committed Jul 4, 2024
1 parent f72e685 commit d403f45
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
18 changes: 17 additions & 1 deletion src/Kontent/Ai/Delivery/DeliveryClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Httpful\Request;
use Httpful\Http;
use Httpful\Response;
use Kontent\Ai\Delivery\Models\Shared\Pagination;
use InvalidArgumentException;
use Exception;
Expand Down Expand Up @@ -72,7 +73,22 @@ class DeliveryClient
*/
public $modelBinder = null;

/**
/**
* Last request made
*
* @var Request|null
*/
public $lastRequest;

/**
* Response from last request made
*
* @var Response
*/
public $lastResponse;


/**
* Creates a new instance of DeliveryClient.
*
* @param string $projectId Kontent.ai Delivery API Project ID
Expand Down
1 change: 1 addition & 0 deletions src/Kontent/Ai/Delivery/Models/Items/ContentItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Class ContentItem.
*/
#[\AllowDynamicProperties]
class ContentItem
{
}
8 changes: 6 additions & 2 deletions tests/Official/CodeExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

class CodeExamplesTests extends TestCase
{
protected function setUp(): void
/** @var DeliveryClient */
private $client;


protected function setUp(): void
{
$this->client = new DeliveryClient('975bf280-fd91-488c-994c-2f04416e5ee3');
}
Expand Down Expand Up @@ -108,4 +112,4 @@ public function test_getContentInSpecificLanguageNoFallback()

$this->assertNotNull($item);
}
}
}

0 comments on commit d403f45

Please sign in to comment.