Skip to content

Issue with Asset class Query method #4

@mallardduck

Description

@mallardduck

Issue description

As the title implies the current implementation of the Assets class incorrectly defines a Query() method which collides with the parent classes query($_query = array()) method.

Here is the main text of the exception this throws:

ContextErrorExceptionWarning: Declaration of Contentstack\Stack\Assets\Assets::Query() should be compatible with Contentstack\Stack\ContentType\BaseQuery\BaseQuery::query($_query = Array)

Steps to reproduce the issue

  1. Setup the PHP demo app - using the PR submitted there: Fix PHP demo for current CS PHP SDK contentstack-symfony-php-blog-demo#1
  2. Add the current PHP SDK.
  3. Insert your Stack ID and Key.
  4. Run the symphony server and load the page.

What's the expected result?

That the library will load without exceptions.

What's the actual result?

The library loads with exceptions. Potentially this is specific to the version of PHP being used - it's possible that older PHP versions didn't throw and Exception here.

Additional details / screenshot

console-error

web-error

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions