Refactor code for improved readability and consistency
- Removed unnecessary blank lines in various files to enhance code clarity. - Updated comments for consistency and clarity across multiple classes and methods. - Adjusted spacing in test files for better formatting and readability.
This commit is contained in:
@@ -23,7 +23,7 @@ trait HasPropertiesJson
|
||||
|
||||
foreach ($this->properties as $property) {
|
||||
$attributeSlug = $property->attribute->slug;
|
||||
|
||||
|
||||
if (! isset($propertiesJson[$attributeSlug])) {
|
||||
$propertiesJson[$attributeSlug] = [];
|
||||
}
|
||||
@@ -34,12 +34,12 @@ trait HasPropertiesJson
|
||||
if ($value->value) {
|
||||
$propertiesJson[$attributeSlug][] = $value->value->key;
|
||||
}
|
||||
|
||||
|
||||
if ($value->product_custom_value) {
|
||||
$propertiesJson[$attributeSlug][] = $value->product_custom_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Unique values just in case
|
||||
$propertiesJson[$attributeSlug] = array_values(array_unique($propertiesJson[$attributeSlug]));
|
||||
}
|
||||
|
||||
@@ -27,16 +27,16 @@ class Product extends Model implements HasMedia, Viewable
|
||||
*/
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Has Schemaless Attributes (spatie/laravel-schemaless-attributes)
|
||||
*/
|
||||
use HasSchemalessAttributes;
|
||||
|
||||
/**
|
||||
* Has Properties Json
|
||||
*/
|
||||
use HasPropertiesJson;
|
||||
|
||||
/**
|
||||
* Has Schemaless Attributes (spatie/laravel-schemaless-attributes)
|
||||
*/
|
||||
use HasSchemalessAttributes;
|
||||
|
||||
/**
|
||||
* Has Slug (spatie/laravel-sluggable)
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property int $id
|
||||
* @property string $version
|
||||
* @property string $os
|
||||
* @property bool $important
|
||||
* @property bool $important
|
||||
* @property string $notes
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
|
||||
Reference in New Issue
Block a user