fix(phpstan): code improvements and resolve warnings
Reviewed code and made several improvements which provide better error handling, code quality, and resolved warnings. The changes include:
- Syntax modifications for better readability,
- Ensured variable type checks before using methods,
- Resolved warning instances in phpstan,
- Adapted code to comply with modern PHP nullable type indicator.
Alongside, made version update in phive/phars.xml. Also, unnecessary comments or instances are removed for a cleaner code.
Related: #16 (closed)