Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredtking committed Jul 26, 2023
1 parent b45261c commit ac21bc7
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/DefinitionBuilder.php
Expand Up @@ -82,9 +82,9 @@ public static function build(array $ids, array $properties, string $modelClass):
return new Definition($ids, $result);
}

// ///////////////////////////////
//
// Relationship Shortcuts
// ///////////////////////////////
//

/**
* This is added for BC with older versions of pulsar
Expand Down
6 changes: 3 additions & 3 deletions src/Driver/DbalDriver.php
Expand Up @@ -222,9 +222,9 @@ public function min(Query $query, string $field): float
return (float) $this->executeScalar($dbQuery, $model, $field);
}

// ////////////////////////
// / Helpers
// ////////////////////////
//
// Helpers
//

/**
* Builds a new select query.
Expand Down
16 changes: 8 additions & 8 deletions src/Errors.php
Expand Up @@ -138,9 +138,9 @@ public function __toString(): string
return implode("\n", $this->all());
}

// ////////////////////////
//
// Helpers
// ////////////////////////
//

/**
* Formats an incoming error message.
Expand All @@ -162,18 +162,18 @@ private function parse(string $error, array $context): string
return $this->getTranslator()->translate($error, $context, null);
}

// ////////////////////////
//
// IteratorAggregate Interface
// ////////////////////////
//

public function getIterator(): Traversable
{
return new ArrayIterator($this->stack);
}

// ////////////////////////
//
// Countable Interface
// ////////////////////////
//

/**
* Get total number of models matching query.
Expand All @@ -183,9 +183,9 @@ public function count(): int
return count($this->stack);
}

// ///////////////////////////
//
// ArrayAccess Interface
// ///////////////////////////
//

public function offsetExists($offset): bool
{
Expand Down
16 changes: 8 additions & 8 deletions src/Iterator.php
Expand Up @@ -56,9 +56,9 @@ public function getQuery(): Query
return $this->query;
}

// ////////////////////////
//
// Iterator Interface
// ////////////////////////
//

/**
* Rewind the Iterator to the first element.
Expand Down Expand Up @@ -122,9 +122,9 @@ public function valid(): bool
return null !== $this->current();
}

// ////////////////////////
//
// Countable Interface
// ////////////////////////
//

/**
* Get total number of models matching query.
Expand All @@ -136,9 +136,9 @@ public function count(): int
return $this->count;
}

// ////////////////////////
//
// ArrayAccess Interface
// ////////////////////////
//

public function offsetExists($offset): bool
{
Expand Down Expand Up @@ -173,9 +173,9 @@ public function offsetUnset($offset)
throw new \Exception('Cannot perform unset on immutable Iterator');
}

// ////////////////////////
//
// Private Methods
// ////////////////////////
//

/**
* Load the next round of models.
Expand Down
40 changes: 20 additions & 20 deletions src/Model.php
Expand Up @@ -36,9 +36,9 @@ abstract class Model implements ArrayAccess
{
const DEFAULT_ID_NAME = 'id';

// ///////////////////////////
//
// Model visible variables
// ///////////////////////////
//

protected array $_values = [];
private array $_unsaved = [];
Expand All @@ -47,9 +47,9 @@ abstract class Model implements ArrayAccess
/** @var AbstractRelation[] */
private array $relationships = [];

// ///////////////////////////
//
// Base model variables
// ///////////////////////////
//

private static array $initialized = [];
private static ?DriverInterface $driver = null;
Expand Down Expand Up @@ -210,9 +210,9 @@ public function hasId(): bool
return $this->hasId;
}

// ///////////////////////////
//
// Magic Methods
// ///////////////////////////
//

/**
* Converts the model into a string.
Expand Down Expand Up @@ -297,9 +297,9 @@ public function __unset(string $name): void
}
}

// ///////////////////////////
//
// ArrayAccess Interface
// ///////////////////////////
//

public function offsetExists($offset): bool
{
Expand Down Expand Up @@ -331,9 +331,9 @@ public static function __callStatic($name, $parameters)
return call_user_func_array([static::query(), $name], $parameters);
}

// ///////////////////////////
//
// Property Definitions
// ///////////////////////////
//

/**
* Gets the model definition.
Expand Down Expand Up @@ -442,9 +442,9 @@ public static function getAccessor(string $property): ?string
return self::$accessors[$k];
}

// ///////////////////////////
//
// CRUD Operations
// ///////////////////////////
//

/**
* Gets the table name for storing this model.
Expand Down Expand Up @@ -1104,9 +1104,9 @@ public function isDeleted(): bool
return !$this->_persisted;
}

// ///////////////////////////
//
// Queries
// ///////////////////////////
//

/**
* Generates a new query instance.
Expand Down Expand Up @@ -1227,9 +1227,9 @@ public function clearCache(): static
return $this;
}

// ///////////////////////////
//
// Relationships
// ///////////////////////////
//

/**
* Gets the relationship manager for a property.
Expand Down Expand Up @@ -1362,9 +1362,9 @@ public function clearRelation(string $k): static
return $this;
}

// ///////////////////////////
//
// Events
// ///////////////////////////
//

/**
* Adds a listener to the model.creating and model.updating events.
Expand Down Expand Up @@ -1452,9 +1452,9 @@ public static function deleted(callable $listener, int $priority = 0): void
EventManager::listen(static::class, ModelDeleted::NAME, $listener, $priority);
}

// ///////////////////////////
//
// Validation
// ///////////////////////////
//

/**
* Gets the error stack for this model.
Expand Down
32 changes: 16 additions & 16 deletions tests/ModelTest.php
Expand Up @@ -1077,9 +1077,9 @@ public function testDirtyHasChangedCheck()
$this->assertTrue($model->dirty('test', true));
}

// ///////////////////////////
//
// CREATE
// ///////////////////////////
//

public function testCreate()
{
Expand Down Expand Up @@ -1561,9 +1561,9 @@ public function testCreateEncrypted()
$this->assertEquals('encrypted value', $newModel->encrypted);
}

// ///////////////////////////
//
// SET
// ///////////////////////////
//

public function testSet()
{
Expand Down Expand Up @@ -1927,9 +1927,9 @@ public function testSetEncryptedNotModified()
$this->assertEquals('encrypted value', $model->encrypted);
}

// ///////////////////////////
//
// DELETE
// ///////////////////////////
//

public function testDelete()
{
Expand Down Expand Up @@ -2167,9 +2167,9 @@ public function testRestoreUpdatedEventFail()
$this->assertFalse($model->restore());
}

// ///////////////////////////
//
// Queries
// ///////////////////////////
//

public function testQuery()
{
Expand Down Expand Up @@ -2262,9 +2262,9 @@ public function testFindOrFailNotFound()
$this->assertFalse(TestModel::findOrFail(101));
}

// ///////////////////////////
//
// Relationships
// ///////////////////////////
//

public function testRelation()
{
Expand Down Expand Up @@ -2327,9 +2327,9 @@ public function testSetRelation()
$this->assertEquals('2,3', $model->relation);
}

// ///////////////////////////
//
// Belongs To Relationship
// ///////////////////////////
//

public function testGetPropertiesBelongsTo()
{
Expand Down Expand Up @@ -2578,9 +2578,9 @@ public function testGetFromDbBelongsTo()
$this->assertEquals('Bob Loblaw', $invoice->customer->name);
}

// ///////////////////////////
//
// Storage
// ///////////////////////////
//

public function testRefresh()
{
Expand Down Expand Up @@ -2624,9 +2624,9 @@ public function testPersisted()
$this->assertTrue($model->persisted());
}

// ///////////////////////////
//
// Validations
// ///////////////////////////
//

public function testValid()
{
Expand Down

0 comments on commit ac21bc7

Please sign in to comment.