Webmozart\Assert\Assert::file PHP Method

file() public static method

public static file ( $value, $message = '' )
    public static function file($value, $message = '')
    {
        static::fileExists($value, $message);
        if (!is_file($value)) {
            static::reportInvalidArgument(sprintf($message ?: 'The path %s is not a file.', static::valueToString($value)));
        }
    }

Usage Example

Example #1
0
 /**
  * Creates a new AsciiDoc descriptor.
  *
  * @param ExecutableFinder $executableFinder The finder used to find the
  *                                           "man" binary.
  * @param ProcessLauncher  $processLauncher  The launcher for executing the
  *                                           "man" binary.
  */
 public function __construct($path, ExecutableFinder $executableFinder = null, ProcessLauncher $processLauncher = null)
 {
     Assert::file($path);
     $this->path = $path;
     $this->executableFinder = $executableFinder ?: new ExecutableFinder();
     $this->processLauncher = $processLauncher ?: new ProcessLauncher();
 }
All Usage Examples Of Webmozart\Assert\Assert::file