Skip to content

Commit

Permalink
Fix code styling according to PSR12
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Oct 5, 2021
1 parent be52db2 commit ac8bfdb
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Helper/AccessKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function create($key): AccessKey

$key_string = strval($key);

$key = new self;
$key = new self();
$key->raw = $key_string;

$keys = explode('.', $key_string);
Expand Down
2 changes: 1 addition & 1 deletion src/Manager/ErrorAbortManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function parse(Input $input): Accessable

$document = $this->getFactory()->make(
'Document',
[$object, $this, new RootAccessable]
[$object, $this, new RootAccessable()]
);

// Clear config
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/AccessableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AccessableTest extends TestCase
*/
public function testBcForAccessableInterface()
{
$class = new class() implements Accessable {
$class = new class () implements Accessable {
/**
* Get a value by a key
*
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/ElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testBcForElementInterface()
$manager = $this->createMock(Manager::class);
$parent = $this->createMock(Accessable::class);

$class = new class($data, $manager, $parent) implements Element {
$class = new class ($data, $manager, $parent) implements Element {
/**
* Sets the manager and parent
*
Expand Down
3 changes: 2 additions & 1 deletion tests/BC/Exception/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class ExceptionTest extends TestCase
*/
public function testBcForExceptionInterface()
{
$class = new class() implements Exception {};
$class = new class () implements Exception {
};

$this->assertInstanceOf(Exception::class, $class);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FactoryTest extends TestCase
*/
public function testBcForFactoryInterface()
{
$class = new class() implements Factory {
$class = new class () implements Factory {
/**
* Create a new instance of a class
*
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/Input/InputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class InputTest extends TestCase
*/
public function testBcForInputInterface()
{
$class = new class() implements Input {
$class = new class () implements Input {
/**
* Get the input as simple object
*
Expand Down
3 changes: 2 additions & 1 deletion tests/BC/Input/RequestInputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class RequestInputTest extends TestCase
*/
public function testBcForRequestInputInterface()
{
$class = new class() implements RequestInput {};
$class = new class () implements RequestInput {
};

$this->assertInstanceOf(RequestInput::class, $class);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ManagerTest extends TestCase
*/
public function testBcForManagerInterface()
{
$class = new class() implements Manager {
$class = new class () implements Manager {
/**
* Parse the input
*
Expand Down
2 changes: 1 addition & 1 deletion tests/BC/Serializer/SerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SerializerTest extends TestCase
*/
public function testBcForSerializerInterface()
{
$class = new class() implements Serializer {
$class = new class () implements Serializer {
/**
* Serialize data
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/HelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function jsonValuesAsStringProviderWithoutObject()
public function buildManagerMock()
{
// Mock factory
$factory = new FixtureFactory;
$factory = new FixtureFactory();
$factory->testcase = $this;

// Mock Manager
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/DotNotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DotNotationTest extends \Art4\JsonApiClient\Tests\Fixtures\TestCase
*/
public function testCompleteResourceObjectWithMultipleRelationships()
{
$manager = new ErrorAbortManager(new Factory);
$manager = new ErrorAbortManager(new Factory());

$string = $this->getJsonString('04_complete_document_with_multiple_relationships.json');

Expand Down Expand Up @@ -204,7 +204,7 @@ public function testCompleteResourceObjectWithMultipleRelationships()
*/
public function testGetNotExistentValueThrowsException()
{
$manager = new ErrorAbortManager(new Factory);
$manager = new ErrorAbortManager(new Factory());

$string = $this->getJsonString('05_simple_meta_object.json');

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/SerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function jsonapiDataProvider()
*/
public function parseJsonapiDataWithErrorAbortManager($filename, array $meta)
{
$manager = new ErrorAbortManager(new Factory);
$manager = new ErrorAbortManager(new Factory());

$string = $this->getJsonString($filename);

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Serializer/ArraySerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ArraySerializerTest extends TestCase
public function testSerialize()
{
$object1 = $this->createMock(Accessable::class);
$object2 = new \stdClass;
$object2 = new \stdClass();

$data = $this->createMock(Accessable::class);
$data->method('get')->will($this->returnValueMap([
Expand Down Expand Up @@ -71,7 +71,7 @@ public function testSerialize()
*/
public function testRecursiveSerialize()
{
$stdObject = new \stdClass;
$stdObject = new \stdClass();
$stdObject->key = 'value';

$object1 = $this->createMock(Accessable::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/V1/ErrorCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testCreate()

$this->assertSame($collection->getKeys(), [0, 1]);

$this->assertFalse($collection->has(new \stdClass));
$this->assertFalse($collection->has(new \stdClass()));
$this->assertFalse($collection->has([]));
$this->assertFalse($collection->has('string'));

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/V1/ErrorLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function testCreateWithoutObjectOrStringAttributeThrowsException($input)
*/
public function testAboutWithDataproviderThrowsException($input)
{
$object = new \stdClass;
$object = new \stdClass();
$object->about = $input;

$this->expectException(ValidationException::class);
Expand Down

0 comments on commit ac8bfdb

Please sign in to comment.