Remove unused ConfigException class, make code style adjustments

Deleted ConfigException class as it was not being used anywhere in the project.
Code style adjustments were made to conform with the PSR-12 coding standard. This includes property and variable naming conventions, use of strict equality operators, reformatting of code and removal of unnecessary comments. The .idea/php.xml file was also updated to a newer version of the library.
Log functions are updated to throw exceptions for non-existent message and invalid level. Also, LogLib is now registered/unregistered  as an exception handler.
Other adjustments were made to achieve consistency in the codebase including renaming properties for clarity, moving magic strings into constants, improving code readability and adding descriptive comments.
This commit is contained in:
Netkas 2023-10-10 23:29:26 -04:00
parent 892c4c7ad7
commit 4fa87c349c
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
18 changed files with 666 additions and 494 deletions

View file

@ -1,8 +1,37 @@
build:
ncc build --config="release" --log-level debug
# Variables
NCC = ncc
PACKAGE_NAME = net.nosial.loglib.ncc
BUILD_CONFIG = release
BUILD_STATIC_CONFIG = release_static
install:
sudo ncc package install --package="build/release/net.nosial.loglib.ncc" --skip-dependencies --reinstall -y --log-level debug
# Directories
SRC_DIR = src
BUILD_DIR = build
RELEASE_BUILD_DIR = $(BUILD_DIR)/$(BUILD_CONFIG)
RELEASE_STATIC_BUILD_DIR = $(BUILD_DIR)/$(BUILD_STATIC_CONFIG)
.PHONY: all release release_static install uninstall clean
all: release release_static install
release: prepare_build
$(NCC) build --config=$(BUILD_CONFIG) --out-dir=$(RELEASE_BUILD_DIR)
release_static: prepare_build_static
$(NCC) build --config=$(BUILD_STATIC_CONFIG) --out-dir=$(RELEASE_STATIC_BUILD_DIR)
install: prepare_build
$(NCC) package install --package="$(RELEASE_BUILD_DIR)/$(PACKAGE_NAME)" --skip-dependencies -y
uninstall:
$(NCC) package uninstall -y --package="$(PACKAGE_NAME)"
clean:
rm -rf build
rm -rf $(RELEASE_BUILD_DIR)
rm -rf $(RELEASE_STATIC_BUILD_DIR)
prepare_build:
mkdir -p $(RELEASE_BUILD_DIR)
prepare_build_static:
mkdir -p $(RELEASE_STATIC_BUILD_DIR)