src/LinearAlgebra/MatrixFactory.php
private static function checkParams(array $A): bool
    {
        if (empty($A)) {
            throw new Exception\BadDataException('Array data not provided for Matrix creation');
        }

        if (isset($A[0]) && is_array($A[0])) {
            $column_count = count($A[0]);
            foreach ($A as $i => $row) {
                if (count($row) !== $column_count) {
                    throw new Exception\MatrixException("Row $i has a different column count: " . count($row) . "; was expecting $column_count.");
                }
            }
        }

        return true;
    }
private static function checkParams(array $A): bool
    {
        if (empty($A)) {
            throw new Exception\BadDataException('Array data not provided for Matrix creation');
        }

        if (isset($A[0]) && is_array($A[0])) {
            $column_count = count($A[0]);
            foreach ($A as $i => $row) {
                if (count($row) !== $column_count) {
                    throw new Exception\MatrixException("Row $i has a different column count: " . count($row) . "; was expecting $column_count.");
                }
            }
        }

        return true;
    }
private static function checkParams ( array $ A ) : bool { if ( empty ( $ A ) ) { throw new Exception \ BadDataException ( 'Array data not provided for Matrix creation' ) ; } if ( isset ( $ A [ 0 ] ) && is_array ( $ A [ 0 ] ) ) { $ column_count = count ( $ A [ 0 ] ) ; foreach ( $ A as $ i => $ row ) { if ( count ( $ row ) !== $ column_count ) { throw new Exception \ MatrixException ( "Row $i has a different column count: " . count ( $ row ) . "; was expecting $column_count." ) ; } } } return true ; }
Check input parameters

@param  array    $A

@return bool

@throws Exception\BadDataException if array data not provided for matrix creation
@throws Exception\MatrixException if any row has a different column count
Check input parameters