Skip to content

Commit

Permalink
Pinting The Project
Browse files Browse the repository at this point in the history
  • Loading branch information
Blair2004 committed Jan 7, 2024
1 parent 822e315 commit b34fcd4
Show file tree
Hide file tree
Showing 751 changed files with 15,038 additions and 15,073 deletions.
2 changes: 1 addition & 1 deletion app/Casts/CurrencyCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CurrencyCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return (string) ns()->currency->define( $value );
return (string) ns()->currency->define($value);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Casts/DateCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class DateCast implements CastsAttributes
*/
public function get($model, $key, $value, $attributes)
{
if ( $value !== null ) {
return ns()->date->getFormatted( $value );
if ($value !== null) {
return ns()->date->getFormatted($value);
}

return $value;
Expand Down
8 changes: 4 additions & 4 deletions app/Casts/DiscountTypeCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class DiscountTypeCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return match ( $value ) {
'percentage_discount' => __( 'Percentage' ),
'flat_discount' => __( 'Flat' ),
default => __( 'Unknown Type' ),
return match ($value) {
'percentage_discount' => __('Percentage'),
'flat_discount' => __('Flat'),
default => __('Unknown Type'),
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/Casts/FloatConvertCasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FloatConvertCasting implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return ns()->math->set( $value ?: 0 )->toFloat();
return ns()->math->set($value ?: 0)->toFloat();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/Casts/GenderCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class GenderCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return match ( $value ) {
'male' => __( 'Male' ),
'female' => __( 'Female' ),
default => __( 'Not Defined' ),
return match ($value) {
'male' => __('Male'),
'female' => __('Female'),
default => __('Not Defined'),
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/Casts/NotDefinedCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NotDefinedCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return empty( $value ) ? __( 'Not Defined' ) : $value;
return empty($value) ? __('Not Defined') : $value;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Casts/OrderDeliveryCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function get($model, string $key, $value, array $attributes)
/**
* @var OrdersService $orderService
*/
$orderService = app()->make( OrdersService::class );
$orderService = app()->make(OrdersService::class);

return $orderService->getDeliveryStatus( $value );
return $orderService->getDeliveryStatus($value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Casts/OrderPaymentCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OrderPaymentCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return ns()->order->getPaymentLabel( $value );
return ns()->order->getPaymentLabel($value);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Casts/OrderProcessCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function get($model, string $key, $value, array $attributes)
/**
* @var OrdersService $orderService
*/
$orderService = app()->make( OrdersService::class );
$orderService = app()->make(OrdersService::class);

return $orderService->getProcessStatus( $value );
return $orderService->getProcessStatus($value);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Casts/OrderTypeCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function get($model, string $key, $value, array $attributes)
/**
* @var OrdersService $orderService
*/
$orderService = app()->make( OrdersService::class );
$orderService = app()->make(OrdersService::class);

return $orderService->getTypeLabel( $value );
return $orderService->getTypeLabel($value);
}

/**
Expand Down
44 changes: 22 additions & 22 deletions app/Casts/ProductHistoryActionCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class ProductHistoryActionCast implements CastsAttributes
*
* @param array<string, mixed> $attributes
*/
public function get( Model|CrudEntry $model, string $key, mixed $value, array $attributes): mixed
public function get(Model|CrudEntry $model, string $key, mixed $value, array $attributes): mixed
{
switch ( $value ) {
switch ($value) {
case ProductHistory::ACTION_ADDED :
case ProductHistory::ACTION_ADJUSTMENT_RETURN :
case ProductHistory::ACTION_RETURNED :
Expand All @@ -31,26 +31,26 @@ public function get( Model|CrudEntry $model, string $key, mixed $value, array $a
break;
}

return match ( $value ) {
ProductHistory::ACTION_SET => __( 'Assignation' ),
ProductHistory::ACTION_STOCKED => __( 'Stocked' ),
ProductHistory::ACTION_DEFECTIVE => __( 'Defective' ),
ProductHistory::ACTION_DELETED => __( 'Deleted' ),
ProductHistory::ACTION_REMOVED => __( 'Removed' ),
ProductHistory::ACTION_RETURNED => __( 'Returned' ),
ProductHistory::ACTION_SOLD => __( 'Sold' ),
ProductHistory::ACTION_LOST => __( 'Lost' ),
ProductHistory::ACTION_ADDED => __( 'Added' ),
ProductHistory::ACTION_TRANSFER_IN => __( 'Incoming Transfer' ),
ProductHistory::ACTION_TRANSFER_OUT => __( 'Outgoing Transfer' ),
ProductHistory::ACTION_TRANSFER_REJECTED => __( 'Transfer Rejected' ),
ProductHistory::ACTION_TRANSFER_CANCELED => __( 'Transfer Canceled' ),
ProductHistory::ACTION_VOID_RETURN => __( 'Void Return' ),
ProductHistory::ACTION_ADJUSTMENT_RETURN => __( 'Adjustment Return' ),
ProductHistory::ACTION_ADJUSTMENT_SALE => __( 'Adjustment Sale' ),
ProductHistory::ACTION_CONVERT_IN => __( 'Incoming Conversion' ),
ProductHistory::ACTION_CONVERT_OUT => __( 'Outgoing Conversion' ),
default => __( 'Unknown Action' ),
return match ($value) {
ProductHistory::ACTION_SET => __('Assignation'),
ProductHistory::ACTION_STOCKED => __('Stocked'),
ProductHistory::ACTION_DEFECTIVE => __('Defective'),
ProductHistory::ACTION_DELETED => __('Deleted'),
ProductHistory::ACTION_REMOVED => __('Removed'),
ProductHistory::ACTION_RETURNED => __('Returned'),
ProductHistory::ACTION_SOLD => __('Sold'),
ProductHistory::ACTION_LOST => __('Lost'),
ProductHistory::ACTION_ADDED => __('Added'),
ProductHistory::ACTION_TRANSFER_IN => __('Incoming Transfer'),
ProductHistory::ACTION_TRANSFER_OUT => __('Outgoing Transfer'),
ProductHistory::ACTION_TRANSFER_REJECTED => __('Transfer Rejected'),
ProductHistory::ACTION_TRANSFER_CANCELED => __('Transfer Canceled'),
ProductHistory::ACTION_VOID_RETURN => __('Void Return'),
ProductHistory::ACTION_ADJUSTMENT_RETURN => __('Adjustment Return'),
ProductHistory::ACTION_ADJUSTMENT_SALE => __('Adjustment Sale'),
ProductHistory::ACTION_CONVERT_IN => __('Incoming Conversion'),
ProductHistory::ACTION_CONVERT_OUT => __('Outgoing Conversion'),
default => __('Unknown Action'),
};
}

Expand Down
16 changes: 8 additions & 8 deletions app/Casts/TransactionOccurrenceCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class TransactionOccurrenceCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return match ( $value ) {
Transaction::OCCURRENCE_X_AFTER_MONTH_STARTS => __( 'Month Starts' ),
Transaction::OCCURRENCE_MIDDLE_OF_MONTH => __( 'Month Middle' ),
Transaction::OCCURRENCE_END_OF_MONTH => __( 'Month Ends' ),
Transaction::OCCURRENCE_X_AFTER_MONTH_STARTS => __( 'X Days After Month Starts' ),
Transaction::OCCURRENCE_X_BEFORE_MONTH_ENDS => __( 'X Days Before Month Ends' ),
Transaction::OCCURRENCE_SPECIFIC_DAY => __( 'On Specific Day' ),
default => __( 'Unknown Occurance' )
return match ($value) {
Transaction::OCCURRENCE_X_AFTER_MONTH_STARTS => __('Month Starts'),
Transaction::OCCURRENCE_MIDDLE_OF_MONTH => __('Month Middle'),
Transaction::OCCURRENCE_END_OF_MONTH => __('Month Ends'),
Transaction::OCCURRENCE_X_AFTER_MONTH_STARTS => __('X Days After Month Starts'),
Transaction::OCCURRENCE_X_BEFORE_MONTH_ENDS => __('X Days Before Month Ends'),
Transaction::OCCURRENCE_SPECIFIC_DAY => __('On Specific Day'),
default => __('Unknown Occurance')
};
}

Expand Down
12 changes: 6 additions & 6 deletions app/Casts/TransactionTypeCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class TransactionTypeCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return match ( $value ) {
Transaction::TYPE_DIRECT => __( 'Direct Transaction' ),
Transaction::TYPE_RECURRING => __( 'Recurring Transaction' ),
Transaction::TYPE_ENTITY => __( 'Entity Transaction' ),
Transaction::TYPE_SCHEDULED => __( 'Scheduled Transaction' ),
default => sprintf( __( 'Unknown Type (%s)' ), $value ),
return match ($value) {
Transaction::TYPE_DIRECT => __('Direct Transaction'),
Transaction::TYPE_RECURRING => __('Recurring Transaction'),
Transaction::TYPE_ENTITY => __('Entity Transaction'),
Transaction::TYPE_SCHEDULED => __('Scheduled Transaction'),
default => sprintf(__('Unknown Type (%s)'), $value),
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/Casts/YesNoBoolCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class YesNoBoolCast implements CastsAttributes
*/
public function get($model, string $key, $value, array $attributes)
{
return (bool) $value ? __( 'Yes' ) : __( 'No' );
return (bool) $value ? __('Yes') : __('No');
}

/**
Expand Down
12 changes: 6 additions & 6 deletions app/Classes/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

class Currency
{
public static function define( $amount )
public static function define($amount)
{
return ns()->currency->define( $amount );
return ns()->currency->define($amount);
}

/**
Expand All @@ -17,13 +17,13 @@ public static function define( $amount )
*
* @param float $amount
*/
public static function fresh( $amount ): CurrencyService
public static function fresh($amount): CurrencyService
{
return ns()->currency->fresh( $amount );
return ns()->currency->fresh($amount);
}

public static function raw( $amount )
public static function raw($amount)
{
return ns()->currency->getRaw( $amount );
return ns()->currency->getRaw($amount);
}
}
14 changes: 7 additions & 7 deletions app/Classes/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ class Output
{
protected $output = [];

public function addOutput( $view )
public function addOutput($view)
{
$this->output[] = $view;
}

public function addView( $view, $options = [])
public function addView($view, $options = [])
{
$this->output[] = View::make( $view, $options );
$this->output[] = View::make($view, $options);

return $this;
}
Expand All @@ -25,15 +25,15 @@ public function clear()
$this->output = [];
}

public function setOutput( $view )
public function setOutput($view)
{
$this->output = [ $view ];
}

public function __toString()
{
return collect( $this->output )
->map( fn( $output ) => (string) $output )
->join( '' );
return collect($this->output)
->map(fn($output) => (string) $output)
->join('');
}
}
38 changes: 19 additions & 19 deletions app/Classes/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,52 @@

class Schema extends ParentSchema
{
public static function table( $table, $callback )
public static function table($table, $callback)
{
return parent::table( Hook::filter( 'ns-table-name', $table ), $callback );
return parent::table(Hook::filter('ns-table-name', $table), $callback);
}

public static function rename( $previous, $new )
public static function rename($previous, $new)
{
return parent::rename( Hook::filter( 'ns-table-name', $previous ), Hook::filter( 'ns-table-name', $new ) );
return parent::rename(Hook::filter('ns-table-name', $previous), Hook::filter('ns-table-name', $new));
}

public static function create( $table, $callback )
public static function create($table, $callback)
{
return parent::create( Hook::filter( 'ns-table-name', $table ), $callback );
return parent::create(Hook::filter('ns-table-name', $table), $callback);
}

public static function createIfMissing( $table, $callback )
public static function createIfMissing($table, $callback)
{
if ( ! parent::hasTable( Hook::filter( 'ns-table-name', $table ) ) ) {
return parent::create( Hook::filter( 'ns-table-name', $table ), $callback );
if (! parent::hasTable(Hook::filter('ns-table-name', $table))) {
return parent::create(Hook::filter('ns-table-name', $table), $callback);
}

return null;
}

public static function hasColumn( $table, $column )
public static function hasColumn($table, $column)
{
return parent::hasColumn( Hook::filter( 'ns-table-name', $table ), $column );
return parent::hasColumn(Hook::filter('ns-table-name', $table), $column);
}

public static function hasTable( $table )
public static function hasTable($table)
{
return parent::hasTable( Hook::filter( 'ns-table-name', $table ) );
return parent::hasTable(Hook::filter('ns-table-name', $table));
}

public static function hasColumns( $table, $columns )
public static function hasColumns($table, $columns)
{
return parent::hasColumns( Hook::filter( 'ns-table-name', $table ), $columns );
return parent::hasColumns(Hook::filter('ns-table-name', $table), $columns);
}

public static function dropIfExists( $table )
public static function dropIfExists($table)
{
return parent::dropIfExists( Hook::filter( 'ns-table-name', $table ) );
return parent::dropIfExists(Hook::filter('ns-table-name', $table));
}

public static function drop( $table )
public static function drop($table)
{
return parent::drop( Hook::filter( 'ns-table-name', $table ) );
return parent::drop(Hook::filter('ns-table-name', $table));
}
}
Loading

0 comments on commit b34fcd4

Please sign in to comment.