src/main/php/Properties.php
public static function fromFile(string $propertiesFile): self
    {
        if (!file_exists($propertiesFile) || !is_readable($propertiesFile)) {
            throw new \InvalidArgumentException(
                    'Property file ' . $propertiesFile . ' not found'
            );
        }

        $propertyData = @parse_ini_file($propertiesFile, true);
        if (false === $propertyData) {
            throw new \UnexpectedValueException(
                    'Property file at ' . $propertiesFile
                    . ' contains errors and can not be parsed: '
                    . lastErrorMessage()->value()
            );
        }

        return new static($propertyData);
    }
public static function fromFile(string $propertiesFile): self
    {
        if (!file_exists($propertiesFile) || !is_readable($propertiesFile)) {
            throw new \InvalidArgumentException(
                    'Property file ' . $propertiesFile . ' not found'
            );
        }

        $propertyData = @parse_ini_file($propertiesFile, true);
        if (false === $propertyData) {
            throw new \UnexpectedValueException(
                    'Property file at ' . $propertiesFile
                    . ' contains errors and can not be parsed: '
                    . lastErrorMessage()->value()
            );
        }

        return new static($propertyData);
    }
public static function fromFile ( string $ propertiesFile ) : self { if ( ! file_exists ( $ propertiesFile ) || ! is_readable ( $ propertiesFile ) ) { throw new \ InvalidArgumentException ( 'Property file ' . $ propertiesFile . ' not found' ) ; } $ propertyData = @ parse_ini_file ( $ propertiesFile , true ) ; if ( false === $ propertyData ) { throw new \ UnexpectedValueException ( 'Property file at ' . $ propertiesFile . ' contains errors and can not be parsed: ' . lastErrorMessage ( ) -> value ( ) ) ; } return new static ( $ propertyData ) ; }
construct class from a file

@api
@param   string  $propertiesFile  full path to file containing properties
@return  \stubbles\values\Properties
@throws  \InvalidArgumentException  if file can not be found or is not readable
@throws  \UnexpectedValueException  if file contains errors and can not be parsed
construct class from a file