Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangjchandler committed Oct 4, 2023
1 parent 8c8d19b commit 6283bfd
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/Actions/InitialiseOrbitalTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Database\Schema\Blueprint;
use Orbit\Contracts\Orbit;
use Orbit\Support\ConfigureBlueprintFromModel;
use Orbit\Support\ModelUsesSoftDeletes;
use ReflectionClass;

class InitialiseOrbitalTable
Expand All @@ -19,7 +18,7 @@ public function shouldInitialise(Orbit&Model $model): bool
$modelFileMTime = filemtime($modelFile);
$databaseMTime = filemtime(config('orbit.paths.database'));

return ($modelFileMTime > $databaseMTime) || !$schemaBuilder->hasTable($model->getTable());
return ($modelFileMTime > $databaseMTime) || ! $schemaBuilder->hasTable($model->getTable());
}

public function migrate(Orbit&Model $model): void
Expand Down
2 changes: 0 additions & 2 deletions src/Actions/MaybeRefreshDatabaseContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
use Orbit\Contracts\Driver;
use Orbit\Contracts\Orbit;
use Orbit\Support\ConfigureBlueprintFromModel;
use Orbit\Support\FillMissingAttributeValues;
use Orbit\Support\FillMissingAttributeValuesFromBlueprint;
use ReflectionClass;

class MaybeRefreshDatabaseContent
{
Expand Down
2 changes: 1 addition & 1 deletion src/Actions/SaveCompiledAttributesToFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function execute(Orbit&Model $model, string $compiledAttributes, Driver $
$fs = new Filesystem();

if ($model->wasChanged($model->getKey())) {
$fs->delete($directory . DIRECTORY_SEPARATOR . $model->getOriginal($model->getKeyName()) . '.' . $driver->extension());
$fs->delete($directory.DIRECTORY_SEPARATOR.$model->getOriginal($model->getKeyName()).'.'.$driver->extension());
}

$fs->put($directory.DIRECTORY_SEPARATOR.$filename, $compiledAttributes);
Expand Down
2 changes: 1 addition & 1 deletion src/Support/ConfigureBlueprintFromModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class ConfigureBlueprintFromModel
{
public static function configure(Orbit & Model $model, Blueprint $blueprint): Blueprint
public static function configure(Orbit&Model $model, Blueprint $blueprint): Blueprint
{
$model->schema($blueprint);

Expand Down
2 changes: 0 additions & 2 deletions src/Support/FillMissingAttributeValuesFromBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Orbit\Support;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Orbit\Contracts\Orbit;

class FillMissingAttributeValuesFromBlueprint
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Drivers/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
expect($driver->parse($json))
->toBe([
'name' => 'Ryan',
'email' => '[email protected]'
'email' => '[email protected]',
]);
});

0 comments on commit 6283bfd

Please sign in to comment.