Skip to content
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/Controllers/Persons.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class Persons extends Secure_Controller
/**
* @param string|null $module_id
*/
public function __construct(string $module_id = null)
public function __construct(?string $module_id = null)
{
parent::__construct($module_id);

Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/Secure_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Secure_Controller extends BaseController
* @param string|null $submodule_id
* @param string|null $menu_group
*/
public function __construct(string $module_id = '', string $submodule_id = null, string $menu_group = null)
public function __construct(string $module_id = '', ?string $submodule_id = null, ?string $menu_group = null)
{
$this->employee = model(Employee::class);
$this->module = model(Module::class);
Expand Down
4 changes: 2 additions & 2 deletions app/Helpers/locale_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ function to_quantity_decimals(?string $number): string
* @param int $type
* @return string
*/
function to_decimals(?string $number, string $decimals = null, int $type = NumberFormatter::DECIMAL): string
function to_decimals(?string $number, ?string $decimals = null, int $type = NumberFormatter::DECIMAL): string
{
if(!isset($number))
{
Expand Down Expand Up @@ -479,7 +479,7 @@ function parse_tax(string $number): mixed
* @param int|null $decimals
* @return false|float|int|mixed|string
*/
function parse_decimals(string $number, int $decimals = null): mixed
function parse_decimals(string $number, ?int $decimals = null): mixed
{
if(empty($number))
{
Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/Email_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct()
* Email sending function
* Example of use: $response = sendEmail('john@doe.com', 'Hello', 'This is a message', $filename);
*/
public function sendEmail(string $to, string $subject, string $message, string $attachment = null): bool
public function sendEmail(string $to, string $subject, string $message, ?string $attachment = null): bool
{
$email = $this->email;

Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/MY_Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(array $config = [])
* @param string|null $attachment
* @return bool
*/
public function sendMail(string $subject, string $body, string $to = null, string $reply_name = null, string $reply_mail = null, string $attachment = null): bool
public function sendMail(string $subject, string $body, ?string $to = null, ?string $reply_name = null, ?string $reply_mail = null, ?string $attachment = null): bool
{
$this->setReplyTo($reply_mail, $reply_name);
$this->setFrom($this->default_sender_address, $this->default_sender_name, $this->default_bounce_address);
Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/Receiving_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function clear_stock_destination(): void
* @param bool $include_deleted
* @return bool
*/
public function add_item(int $item_id, int $quantity = 1, int $item_location = null, float $discount = 0, int $discount_type = 0, float $price = null, string $description = null, string $serialnumber = null, float $receiving_quantity = null, int $receiving_id = null, bool $include_deleted = false): bool
public function add_item(int $item_id, int $quantity = 1, ?int $item_location = null, float $discount = 0, int $discount_type = 0, ?float $price = null, ?string $description = null, ?string $serialnumber = null, ?float $receiving_quantity = null, ?int $receiving_id = null, bool $include_deleted = false): bool
{
$config = config(OSPOS::class)->settings;

Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/Sale_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ public function clear_rewards_remainder(): void
* @param bool|null $line
* @return bool
*/
public function add_item(int &$item_id, int $item_location, string $quantity = '1', string &$discount = '0.0', int $discount_type = 0, int $price_mode = PRICE_MODE_STANDARD, int $kit_price_option = null, int $kit_print_option = null, string $price_override = null, string $description = null, string $serialnumber = null, int $sale_id = null, bool $include_deleted = false, bool $print_option = null, bool $line = null): bool
public function add_item(int &$item_id, int $item_location, string $quantity = '1', string &$discount = '0.0', int $discount_type = 0, int $price_mode = PRICE_MODE_STANDARD, ?int $kit_price_option = null, ?int $kit_print_option = null, ?string $price_override = null, ?string $description = null, ?string $serialnumber = null, ?int $sale_id = null, bool $include_deleted = false, ?bool $print_option = null, ?bool $line = null): bool
{
$item_info = $this->item->get_info_by_id_or_number($item_id, $include_deleted);

Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/Tax_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function get_included_tax(string $quantity, string $price, string $discou
/**
* Updates the sales_tax array which is later saved to the `sales_taxes` table and used for printing taxes on receipts and invoices
*/
public function update_taxes(array &$taxes, string $tax_type, string $tax_group, string $tax_rate, string $tax_basis, string $item_tax_amount, int $tax_group_sequence, int $rounding_code, int $sale_id, string $name = '', int $tax_code_id = null, int $jurisdiction_id = null, int $tax_category_id = null): void
public function update_taxes(array &$taxes, string $tax_type, string $tax_group, string $tax_rate, string $tax_basis, string $item_tax_amount, int $tax_group_sequence, int $rounding_code, int $sale_id, string $name = '', ?int $tax_code_id = null, ?int $jurisdiction_id = null, ?int $tax_category_id = null): void
{
$tax_group_index = $this->clean('X' . (float)$tax_rate . '% ' . $tax_group); //TODO: Not sure we should be casting to a float here. The clean() function takes a string, so it just gets converted back to a string and there's risk of inaccuracies in the value displayed.

Expand Down
6 changes: 3 additions & 3 deletions app/Models/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ public function delete_list(array $item_ids): bool
* @param string|null $seed
* @return string
*/
public function get_search_suggestion_format(string $seed = null): string
public function get_search_suggestion_format(?string $seed = null): string
{
$config = config(OSPOS::class)->settings;
$seed .= ',' . $config['suggestions_first_column'];
Expand Down Expand Up @@ -1124,7 +1124,7 @@ public function get_categories(): ResultInterface|bool //TODO: This function
* caution: must be used before item_quantities gets updated, otherwise the average price is wrong!
*
*/
public function change_cost_price(int $item_id, float $items_received, float $new_price, float $old_price = null): bool
public function change_cost_price(int $item_id, float $items_received, float $new_price, ?float $old_price = null): bool
{
if($old_price === null)
{
Expand Down Expand Up @@ -1188,7 +1188,7 @@ public function update_item_description(int $item_id, string $item_description):
* for a multipack environment then the item name should have the
* pack appended to it
*/
public function get_item_name(string $as_name = null): string
public function get_item_name(?string $as_name = null): string
{
$config = config(OSPOS::class)->settings;

Expand Down
2 changes: 1 addition & 1 deletion app/Models/Sale.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ public function create_temp_table(array $inputs): void
/**
* Retrieves all sales that are in a suspended state
*/
public function get_all_suspended(int $customer_id = null): array
public function get_all_suspended(?int $customer_id = null): array
{
if($customer_id == NEW_ENTRY)
{
Expand Down
Loading