Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
LaravelFreelancerNL authored and github-actions[bot] committed Sep 17, 2024
1 parent 73ccd35 commit 0ba40fe
Show file tree
Hide file tree
Showing 33 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
public const EDGE_COLLECTION = 3;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Database\Migrations\Migration;
use LaravelFreelancerNL\Aranguent\Facades\Schema;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelFreelancerNL\Aranguent\Facades\Schema;
use LaravelFreelancerNL\Aranguent\Schema\Blueprint;

return new class () extends Migration {
return new class extends Migration {
/**
* Run the migrations.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected function escapeBinary($value)
*/
public function escape($value, $binary = false)
{
return match(gettype($value)) {
return match (gettype($value)) {
'array' => $this->escapeArray($value),
'boolean' => $this->escapeBool($value),
'double' => (string) $value,
Expand Down Expand Up @@ -249,7 +249,7 @@ protected function escapeString($value, bool $binary = false)
*/
protected function escapeArray(array $array): string
{
foreach($array as $key => $value) {
foreach ($array as $key => $value) {
$array[$key] = $this->escape($value);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Eloquent/Casts/AsArrayObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AsArrayObject extends IlluminateAsArrayObject
*/
public static function castUsing(array $arguments)
{
return new class () implements CastsAttributes {
return new class implements CastsAttributes {
public function get($model, $key, $value, $attributes)
{
if (! isset($attributes[$key])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/MigrationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct($app)
{
parent::__construct($app);

foreach($this->aliases as $key => $alias) {
foreach ($this->aliases as $key => $alias) {
$this->aliases[$key] = $alias;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Concerns/BuildsGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function havingRaw($sql, array $bindings = [], $boolean = 'and')
public function forNestedWhere($aliases = [])
{
$query = $this->newQuery();
foreach($aliases as $alias) {
foreach ($aliases as $alias) {
$query->groups[] = $alias;

}
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Concerns/BuildsSearches.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function searchView(
): IlluminateQueryBuilder {
assert($this->grammar instanceof Grammar);

if(!is_array($fields)) {
if (!is_array($fields)) {
$fields = Arr::wrap($fields);
}
$fields = $this->grammar->convertJsonFields($fields);
Expand Down
6 changes: 3 additions & 3 deletions src/Query/Concerns/BuildsUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait BuildsUpdates
*/
protected function prepareValuesForUpdate(array $values)
{
foreach($values as $key => $value) {
foreach ($values as $key => $value) {
if ($value instanceof Expression) {
$values[$key] = $value->getValue($this->grammar);

Expand Down Expand Up @@ -160,13 +160,13 @@ public function upsert(array $values, $uniqueBy, $update = null)
$values = [$values];
}

foreach($values as $key => $value) {
foreach ($values as $key => $value) {
$values[$key] = $this->grammar->convertJsonFields($value);
$values[$key] = $this->convertIdToKey($values[$key]);
$values[$key] = Arr::undot($values[$key]);
}

foreach($values as $key => $value) {
foreach ($values as $key => $value) {
foreach ($value as $dataKey => $data) {
$values[$key][$dataKey] = $this->bindValue($data, 'upsert');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Concerns/BuildsWheres.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function validateOperator(mixed $operator, mixed $value): array
if ($this->invalidOperator($operator)) {
[$value, $operator] = [$operator, '=='];
}
return array($value, $operator);
return [$value, $operator];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Concerns/CompilesColumns.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected function cleanAlias(IlluminateQueryBuilder $query, int|null|string $al

$elements = explode('.', $alias);

if(
if (
!$query->isTable($elements[0])
&& !$query->isVariable($elements[0])
) {
Expand Down
10 changes: 5 additions & 5 deletions src/Query/Concerns/CompilesDataManipulations.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function compileInsertUsing(IlluminateQueryBuilder $query, array $columns

if ($insertDoc === '') {
$insertValues = [];
foreach($columns as $column) {
foreach ($columns as $column) {
$insertValues[$column] = $this->normalizeColumnReferences($query, $column, 'docs');
}
$insertDoc = $this->generateAqlObject($insertValues);
Expand All @@ -129,7 +129,7 @@ public function compileInsertUsing(IlluminateQueryBuilder $query, array $columns
protected function createUpdateObject($values)
{
$valueStrings = [];
foreach($values as $key => $value) {
foreach ($values as $key => $value) {
if (is_array($value)) {
$valueStrings[] = $key . ': ' . $this->createUpdateObject($value);

Expand Down Expand Up @@ -188,19 +188,19 @@ public function compileUpdate(IlluminateQueryBuilder $query, array|string $value
public function compileUpsert(IlluminateQueryBuilder $query, array $values, array $uniqueBy, array $update)
{
$searchFields = [];
foreach($uniqueBy as $field) {
foreach ($uniqueBy as $field) {
$searchFields[$field] = 'doc.' . $field;
}
$searchObject = $this->generateAqlObject($searchFields);

$updateFields = [];
foreach($update as $field) {
foreach ($update as $field) {
$updateFields[$field] = 'doc.' . $field;
}
$updateObject = $this->generateAqlObject($updateFields);

$valueObjects = [];
foreach($values as $data) {
foreach ($values as $data) {
$valueObjects[] = $this->generateAqlObject($data);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Query/Concerns/CompilesGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function keepColumns(IlluminateQueryBuilder $query, $groups)
return [];
}
$tempGroups = [];
foreach($groups as $group) {
foreach ($groups as $group) {
if ($group instanceof Expression) {
$tempGroups[] = $this->extractGroupVariable($group);
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Concerns/ConvertsIdToKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait ConvertsIdToKey
public function convertIdToKey(mixed $data): mixed
{
if (is_array($data) && array_is_list($data)) {
foreach($data as $key => $value) {
foreach ($data as $key => $value) {
$data[$key] = $this->convertIdInString($value);
}
return $data;
Expand Down
12 changes: 6 additions & 6 deletions src/Query/Concerns/HandlesAqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function wrap($value)
}

if (is_array($value)) {
foreach($value as $key => $subvalue) {
foreach ($value as $key => $subvalue) {
$value[$key] = $this->wrap($subvalue);
}
return $value;
Expand Down Expand Up @@ -220,7 +220,7 @@ public function generateAqlObject(array $data): string
*/
protected function generateAqlObjectString(array $data): string
{
foreach($data as $key => $value) {
foreach ($data as $key => $value) {
$prefix = $this->wrapAttribute($key) . ': ';

if (is_numeric($key)) {
Expand Down Expand Up @@ -269,7 +269,7 @@ public function substituteBindingsIntoRawSql($aql, $bindings)

$bindings = array_reverse($bindings);

foreach($bindings as $key => $value) {
foreach ($bindings as $key => $value) {
$pattern = '/(@' . $key . ')(?![^a-zA-Z_ ,\}\]])/';
$aql = (string) preg_replace(
$pattern,
Expand All @@ -289,7 +289,7 @@ public function substituteBindingsIntoRawSql($aql, $bindings)
*/
public function isJsonSelector($value)
{
if(!is_string($value)) {
if (!is_string($value)) {
return false;
}

Expand Down Expand Up @@ -319,7 +319,7 @@ public function convertJsonFields(mixed $data): mixed
*/
public function convertJsonValuesToDotNotation(array $fields): array
{
foreach($fields as $key => $value) {
foreach ($fields as $key => $value) {
if ($this->isJsonSelector($value)) {
$fields[$key] = str_replace('->', '.', $value);
}
Expand All @@ -333,7 +333,7 @@ public function convertJsonValuesToDotNotation(array $fields): array
*/
public function convertJsonKeysToDotNotation(array $fields): array
{
foreach($fields as $key => $value) {
foreach ($fields as $key => $value) {
if ($this->isJsonSelector($key)) {
$fields[str_replace('->', '.', $key)] = $value;
unset($fields[$key]);
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public function compileSearch(IlluminateQueryBuilder $query, array $search)
}

$predicates = [];
foreach($search['fields'] as $field) {
foreach ($search['fields'] as $field) {
$predicates[] = $this->normalizeColumn($query, $field)
. ' IN TOKENS(' . $search['searchText'] . ', \'' . $search['analyzer'] . '\')';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/DatabaseMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function setMigrationPaths()
{
$migrationSettings = [];

if(property_exists($this, 'realPath')) {
if (property_exists($this, 'realPath')) {
$migrationSettings['--realpath'] = $this->realPath ?? false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Testing/DatabaseTruncation.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function setMigrationPaths()
{
$migrationSettings = [];

if(property_exists($this, 'realPath')) {
if (property_exists($this, 'realPath')) {
$migrationSettings['--realpath'] = $this->realPath ?? false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Testing/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function setMigrationPaths()
{
$migrationSettings = [];

if(property_exists($this, 'realPath')) {
if (property_exists($this, 'realPath')) {
$migrationSettings['--realpath'] = $this->realPath ?? false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function isDotString(string $string): bool
if (!function_exists('mapObjectToArray')) {
function mapObjectToArray(mixed $value): mixed
{
if(!is_object($value) && !is_array($value)) {
if (!is_object($value) && !is_array($value)) {
return $value;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Console/ModelMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

$migrationFiles = scandir($migrationPath);

foreach($migrationFiles as $file) {
foreach ($migrationFiles as $file) {
if (in_array($file, ['.', '..', '.gitkeep'])) {
continue;
}
Expand All @@ -90,7 +90,7 @@

$migrationFiles = scandir($migrationPath);

foreach($migrationFiles as $file) {
foreach ($migrationFiles as $file) {
if (in_array($file, ['.', '..', '.gitkeep'])) {
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Migrations/MigrationRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

afterEach(function () {
$migrations = $this->databaseMigrationRepository->getMigrations(12);
foreach($migrations as $migration) {
foreach ($migrations as $migration) {
$this->databaseMigrationRepository->delete($migration);
}
});
Expand Down Expand Up @@ -92,7 +92,7 @@
"getMigrationBatches2" => 33,
];

foreach($batches as $migration => $batch) {
foreach ($batches as $migration => $batch) {
$this->databaseMigrationRepository->log($migration, $batch);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Query/DataRetrievalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function ($query) use ($residenceId) {
foreach ($characters as $character) {
$count++;
}
if($count > 20) {
if ($count > 20) {
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions tests/Query/DebugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
$query = DB::table('characters');
$query->where('name', 'Gilly');

for($i = 0; $i < 9; $i++) {
for ($i = 0; $i < 9; $i++) {
$query->orWhere('name', $names[$i]);
}

$aql = $query->toRawSql();

$rawAql = 'FOR characterDoc IN characters FILTER `characterDoc`.`name` == "Gilly"';
for($i = 0; $i < 9; $i++) {
for ($i = 0; $i < 9; $i++) {
$rawAql .= ' or `characterDoc`.`name` == "' . $names[$i] . '"';
}
$rawAql .= ' RETURN characterDoc';
Expand Down
Loading

0 comments on commit 0ba40fe

Please sign in to comment.