Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher decimal on moon phases #769

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function crudIndex(Request $request)
// Don't use total as it won't use the distinct() filters (typically when doing
// left join on the entities table)
$filteredCount = $models->total();
//$filteredCount = count($models); //->total()
//$filteredCount = count($models); //->total()
} else {
/** @var Paginator $models */
$models = $base->paginate();
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Families/Trees/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

class ApiController extends Controller
{
use GuestAuthTrait;
use CampaignAware;
use GuestAuthTrait;

protected FamilyTreeService $service;

Expand Down
2 changes: 1 addition & 1 deletion app/Models/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ protected function calculateListConstraints(): self
*/
public function listRange(): array
{
if (! is_array($this->listRange)) {
if (!is_array($this->listRange)) {
return [];
}
return $this->listRange;
Expand Down
28 changes: 14 additions & 14 deletions app/Models/Concerns/Nested.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ protected function callPendingAction()
{
$this->moved = false;

if (! $this->pending && ! $this->exists) {
if (!$this->pending && !$this->exists) {
$this->makeRoot();
}

if (! $this->pending) {
if (!$this->pending) {
return;
}

Expand Down Expand Up @@ -189,7 +189,7 @@ protected function actionRaw()
protected function actionRoot()
{
// Simplest case that do not affect other nodes.
if (! $this->exists) {
if (!$this->exists) {
$cut = $this->getLowerBound() + 1;

$this->setLft($cut);
Expand Down Expand Up @@ -228,7 +228,7 @@ protected function actionAppendOrPrepend(self $parent, $prepend = false)

$cut = $prepend ? $parent->getLft() + 1 : $parent->getRgt();

if (! $this->insertAt($cut)) {
if (!$this->insertAt($cut)) {
return false;
}

Expand Down Expand Up @@ -271,7 +271,7 @@ protected function actionBeforeOrAfter(self $node, $after = false)
*/
public function refreshNode()
{
if (! $this->exists || static::$actionsPerformed === 0) {
if (!$this->exists || static::$actionsPerformed === 0) {
return;
}

Expand Down Expand Up @@ -523,7 +523,7 @@ public function beforeOrAfterNode(self $node, $after = false)
->assertNotDescendant($node)
->assertSameScope($node);

if (! $this->isSiblingOf($node)) {
if (!$this->isSiblingOf($node)) {
$this->setParent($node->getRelationValue('parent'));
}

Expand Down Expand Up @@ -551,7 +551,7 @@ public function insertAfterNode(self $node)
*/
public function insertBeforeNode(self $node)
{
if (! $this->beforeNode($node)->save()) {
if (!$this->beforeNode($node)->save()) {
return false;
}

Expand Down Expand Up @@ -587,7 +587,7 @@ public function up($amount = 1)
->skip($amount - 1)
->first();

if (! $sibling) {
if (!$sibling) {
return false;
}

Expand All @@ -609,7 +609,7 @@ public function down($amount = 1)
->skip($amount - 1)
->first();

if (! $sibling) {
if (!$sibling) {
return false;
}

Expand Down Expand Up @@ -752,12 +752,12 @@ public function newScopedQuery(string $table = null)
public function applyNestedSetScope($query, $table = null)
{
// @phpstan-ignore-next-line
if (! $scoped = $this->getScopeAttributes()) {
if (!$scoped = $this->getScopeAttributes()) {
return $query;
}

// @phpstan-ignore-next-line
if (! $table) {
if (!$table) {
$table = $this->getTable();
}

Expand Down Expand Up @@ -839,7 +839,7 @@ public static function create(array $attributes = [], self $parent = null)
*/
public function getNodeHeight()
{
if (! $this->exists) {
if (!$this->exists) {
return 2;
}

Expand Down Expand Up @@ -1138,7 +1138,7 @@ protected function getArrayableRelations()
*/
protected function hardDeleting()
{
return ! $this->usesSoftDelete() || $this->forceDeleting;
return !$this->usesSoftDelete() || $this->forceDeleting;
}

/**
Expand Down Expand Up @@ -1217,7 +1217,7 @@ protected function assertNotDescendant(self $node)
*/
protected function assertNodeExists(self $node)
{
if (! $node->getLft() || ! $node->getRgt()) {
if (!$node->getLft() || !$node->getRgt()) {
$field = $node->getParentIdName();
$error = \Illuminate\Validation\ValidationException::withMessages([
$field => [__('crud.errors.invalid_node')]
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ public function explorable(): bool
if (empty($this->entity->image_path) && !$this->isReal()) {
return false;
}
return ! ($this->isChunked() && ($this->chunkingError() || $this->chunkingRunning()));
return !($this->isChunked() && ($this->chunkingError() || $this->chunkingRunning()));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/PluginVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ protected function emptyBlock(array $matches)
if (Str::contains($condition, '<i class="missing">')) {
return false;
}
return ! (empty($condition));
return !(empty($condition));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Relations/EntityRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function tags()
'id',
'id'
)
->orderBy('tags.name');
->orderBy('tags.name');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Scopes/AclScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function extend(Builder $builder)
protected function addWithInvisible(Builder $builder)
{
$builder->macro('withInvisible', function (Builder $builder, $withInvisible = true) {
if (! $withInvisible) {
if (!$withInvisible) {
// Sends the default scope
return $builder;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Observers/CampaignObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function saving(Campaign $campaign)
$isPublic = request()->get('is_public', null);
if (!empty($isPublic) && $previousVisibility == Campaign::VISIBILITY_PRIVATE) {
$campaign->visibility_id = Campaign::VISIBILITY_PUBLIC;
// Default to public for now. Later will have REVIEW mode.
// Default to public for now. Later will have REVIEW mode.
} elseif (empty($isPublic) && $previousVisibility != Campaign::VISIBILITY_PRIVATE) {
$campaign->visibility_id = Campaign::VISIBILITY_PRIVATE;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Renderers/DatagridRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private function renderHeadColumn($column)
$class = $column['type'];
if ($type == 'avatar') {
$class = (!empty($column['parent']) ? $this->hidden : $class) . ' w-14';
//$html = null;
//$html = null;
} elseif ($type == 'location') {
$class .= ' ' . $this->hidden;
$label = Arr::get($column, 'label', Module::singular(config('entities.ids.location'), __('entities.location')));
Expand Down
2 changes: 1 addition & 1 deletion app/Renderers/DatagridRenderer2.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function bulks(): array
}
continue;
}
// More specific use cases?
// More specific use cases?
} elseif ($bulk === Layout::ACTION_DELETE) {
if (auth()->check() && auth()->user()->isAdmin()) {
$this->bulks[] = $bulk;
Expand Down
4 changes: 2 additions & 2 deletions app/Rules/EntityFileRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct()
public function passes($attribute, $value)
{
// Not a valid file, don't go further
if ($value instanceof UploadedFile && ! $value->isValid()) {
if ($value instanceof UploadedFile && !$value->isValid()) {
return false;
}

Expand All @@ -48,7 +48,7 @@ public function passes($attribute, $value)
return false;
}

return ! (!in_array($value->getClientOriginalExtension(), ['mp3', 'ogg', 'json']))
return !(!in_array($value->getClientOriginalExtension(), ['mp3', 'ogg', 'json']))



Expand Down
2 changes: 1 addition & 1 deletion app/Sanitizers/CalendarSanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected function cleanMoons(): self

$moons[] = [
'name' => $this->purify($moonNames[$moonCount]),
'fullmoon' => round($moon, 3),
'fullmoon' => round($moon, 10),
'offset' => (int) $moonOffsets[$moonCount],
'colour' => $this->purify($moonColours[$moonCount]),
'id' => (int) $moonId,
Expand Down
2 changes: 1 addition & 1 deletion app/Services/AttributeMentionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function validField(string $value = null): bool
if (!Str::contains($value, ['{', '}'])) {
return false;
}
return ! (Str::contains($value, ['<', '>']));
return !(Str::contains($value, ['<', '>']));
}
/**
* Load all the entity attributes and pre-calculate the values
Expand Down
6 changes: 3 additions & 3 deletions app/Services/Users/PurgeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function firstWarning(): int
FirstWarningJob::dispatch($user->id);
}

$this->count ++;
$this->count++;
}
}, 'users.id', 'id');
return $this->count;
Expand Down Expand Up @@ -245,7 +245,7 @@ public function secondWarning(): int
SecondWarningJob::dispatch($user->id);
}

$this->count ++;
$this->count++;
}
}, 'users.id', 'id');
return $this->count;
Expand Down Expand Up @@ -292,7 +292,7 @@ public function purge(): int
DeleteUser::dispatch($user);
}

$this->count ++;
$this->count++;
}
}, 'users.id', 'id');
return $this->count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class () extends Migration {
/**
* Run the migrations.
*/
Expand All @@ -22,7 +21,7 @@ public function up(): void
public function down(): void
{
Schema::table('entities', function (Blueprint $table) {
//

});
}
};
4 changes: 2 additions & 2 deletions resources/views/calendars/form/_moons.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</div>
<div class="field">
<label class="sr-only">{{ __('calendars.parameters.moon.fullmoon') }}</label>
{!! Form::number('moon_fullmoon[]', $fullmoon['fullmoon'], ['class' => 'w-full', 'step' => '0.01', 'min' => 1, 'aria-label' => __('calendars.parameters.moon.fullmoon')]) !!}
{!! Form::number('moon_fullmoon[]', $fullmoon['fullmoon'], ['class' => 'w-full', 'step' => 'any', 'min' => 1, 'aria-label' => __('calendars.parameters.moon.fullmoon')]) !!}
</div>
</div>
<div class="grid grid-cols-2 gap-2">
Expand Down Expand Up @@ -99,7 +99,7 @@
</div>
<div class="field">
<label class="sr-only">{{ __('calendars.parameters.moon.fullmoon') }}</label>
{!! Form::number('moon_fullmoon[]', null, ['class' => 'w-full', 'step' => '0.01', 'min' => 1, 'aria-label' => __('calendars.parameters.moon.fullmoon')]) !!}
{!! Form::number('moon_fullmoon[]', null, ['class' => 'w-full', 'step' => 'any', 'min' => 1, 'aria-label' => __('calendars.parameters.moon.fullmoon')]) !!}
</div>
</div>
<div class="grid grid-cols-2 gap-2">
Expand Down