Download the PHP package jn-devops/common without Composer
On this page you can find all versions of the php package jn-devops/common. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jn-devops/common
More information about jn-devops/common
Files in jn-devops/common
Package common
Short Description Homeful Common Package
License MIT
Homepage https://github.com/jn-devops/common
Informations about the package common
Homeful Common Package
The Homeful\Common
package is a utility package that contains reusable helpers, constants, enumerations, and abstract types used across the Homeful system. It aims to promote consistency and reduce duplication of logic in other domain-specific packages such as Mortgage, Payment, Property, and Borrower.
๐ฆ Contents
- Utilities
- Classes
- Enumerations
๐งฐ Utilities
documents_path(?string $path = null): string
Returns the path to the /resources/documents
directory.
formatted_age(DateTime $born, ?DateTime $reference = null): string
Returns a human-readable age string based on birthdate.
doc_stamps(mixed $value): float
Returns the documentary stamp fee based on property value.
filter_trim_recursive_array(array $array): array
Trims strings and filters empty values recursively in nested arrays.
dot_shift(&$dot_notation): string
Shifts off the first key in a dot notation string.
titleCase(?string $text, array $exclusions = []): string
Applies Str::title()
but preserves Roman numerals and exceptions.
validateJson(string $json): bool
Returns true if a valid JSON string.
resolveOptionalCollection(DataCollection|Optional|null $collection): Collection
Handles resolution of Spatie DataCollection
and Optional
.
array_when(array $array, $condition, callable $callback): array
Conditionally apply a transformation on an array.
convertNumberToWords(float $value): string
Converts a float value to words.
๐ Core Classes
Homeful\Common\Classes\Input
A collection of constants used for data keys in form input and parameter arrays. Examples include:
Input::TCP
- Total Contract PriceInput::PERCENT_DP
- Percent Down PaymentInput::BP_TERM
- Balance Payment Term
Usage:
Homeful\Common\Classes\Assert
A collection of constants used to assert derived or calculated values in computations:
Assert::LOAN_AMOUNT
Assert::INCOME_REQUIREMENT
Assert::LOAN_AMORTIZATION
Used commonly in unit tests:
๐งฎ AmountCollectionItem
Base class representing any item with:
- a name
- a
Price
value - deductible flag
- a tag
Used as a base for:
AddOnFeeToPayment
DeductibleFeeFromPayment
๐ Enumerations
UploadFile
Maps file-related attributes to suffixes for Media Library collections.
WorkArea
Represents whether a user operates in a Highly Urbanized City or Region.
โ Example Usage
๐ Path Resolution
๐งช Testing Helpers
Used extensively in test scripts to:
- Assert expected results via
Assert
- Pass parameters using
Input
- Use
formatted_age
,doc_stamps
, etc.
Behold, a new you awaits. โจ
All versions of common with dependencies
illuminate/contracts Version ^10.0||^11.0
propaganistas/laravel-phone Version ^5.3
spatie/laravel-data Version ^4.13
spatie/laravel-package-tools Version ^1.16
spatie/laravel-schemaless-attributes Version ^2.5
whitecube/php-prices Version ^3.1