PHP Classes

File: src/InvalidArgumentException.php

Recommend this page to a friend!
  Classes of Vitaly   QuEasy PHP PSR Logger   src/InvalidArgumentException.php   Download  
File: src/InvalidArgumentException.php
Role: Class source
Content type: text/plain
Description: Class source
Class: QuEasy PHP PSR Logger
Log messages to containers compliant with PSR-3
Author: By
Last change:
Date: 3 years ago
Size: 1,185 bytes
 

Contents

Class file image Download
<?php

/*
 * Queasy PHP Framework - Logger
 *
 * (c) Vitaly Demyanenko <vitaly_demyanenko@yahoo.com>
 *
 * For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
 */

namespace queasy\log;

use
Psr\Log\InvalidArgumentException as PsrLogInvalidArgumentException;

/**
 * InvalidArgumentException
 */
class InvalidArgumentException extends PsrLogInvalidArgumentException
{
    public static function
loggerNotExists($className)
    {
        return new
InvalidArgumentException(sprintf('Logger class "%s" does not exist.', $className));
    }

    public static function
notImplementsInterface($className, $interfaceName)
    {
        return new
InvalidArgumentException(sprintf('Logger class "%s" does not implement "%s".', $className, $interfaceName));
    }

    public static function
invalidContext()
    {
        return new
InvalidArgumentException('Value of \'exception\' key in log message context does not contain valid Throwable or Exception instance.');
    }

    public static function
unknownField($field)
    {
        return new
InvalidArgumentException(sprintf('Unknown field "%s"', $field));
    }
}