Skip to content

Commit

Permalink
define all dataProvider as static
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Oct 12, 2023
1 parent fb2fe83 commit 2c18914
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions tests/Fixtures/HelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ trait HelperTrait
*
* @see http://json.org/
*/
public function jsonValuesProvider()
public static function jsonValuesProvider(): array
{
return [
[new \stdClass()],
Expand All @@ -53,9 +53,9 @@ public function jsonValuesProvider()
*
* @see http://json.org/
*/
public function jsonValuesProviderWithoutObject()
public static function jsonValuesProviderWithoutObject(): array
{
$data = $this->jsonValuesProvider();
$data = static::jsonValuesProvider();

unset($data[0]);

Expand All @@ -67,9 +67,9 @@ public function jsonValuesProviderWithoutObject()
*
* @see http://json.org/
*/
public function jsonValuesProviderWithoutArray()
public static function jsonValuesProviderWithoutArray(): array
{
$data = $this->jsonValuesProvider();
$data = static::jsonValuesProvider();

unset($data[1]);

Expand All @@ -81,9 +81,9 @@ public function jsonValuesProviderWithoutArray()
*
* @see http://json.org/
*/
public function jsonValuesProviderWithoutString()
public static function jsonValuesProviderWithoutString(): array
{
$data = $this->jsonValuesProvider();
$data = static::jsonValuesProvider();

unset($data[2]);

Expand All @@ -95,9 +95,9 @@ public function jsonValuesProviderWithoutString()
*
* @see http://json.org/
*/
public function jsonValuesProviderWithoutObjectAndString()
public static function jsonValuesProviderWithoutObjectAndString(): array
{
$data = $this->jsonValuesProvider();
$data = static::jsonValuesProvider();

unset($data[0]);
unset($data[2]);
Expand All @@ -110,7 +110,7 @@ public function jsonValuesProviderWithoutObjectAndString()
*
* @see http://json.org/
*/
public function jsonValuesAsStringProvider()
public static function jsonValuesAsStringProvider(): array
{
return [
['{}'],
Expand All @@ -130,9 +130,9 @@ public function jsonValuesAsStringProvider()
*
* @see http://json.org/
*/
public function jsonValuesAsStringProviderWithoutObject()
public static function jsonValuesAsStringProviderWithoutObject(): array
{
$data = $this->jsonValuesAsStringProvider();
$data = static::jsonValuesAsStringProvider();

unset($data[0]);

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ParsingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ParsingTest extends \Art4\JsonApiClient\Tests\Fixtures\TestCase
/**
* Provide Parser
*/
public function createParserProvider()
public static function createParserProvider(): array
{
$errorAbortManagerParser = function ($string) {
$manager = new ErrorAbortManager(new Factory());
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/SerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SerializerTest extends TestCase
/**
* Provide JSON API data
*/
public function jsonapiDataProvider()
public static function jsonapiDataProvider(): array
{
$path = str_replace('/', \DIRECTORY_SEPARATOR, __DIR__ . '/../files/');
$files = [];
Expand Down

0 comments on commit 2c18914

Please sign in to comment.