Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Commit

Permalink
A bit more explicit if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
matejvelikonja committed Aug 26, 2014
1 parent de6e39d commit a7a7a04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Nmap/Nmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function __construct(ProcessExecutor $executor = null, $outputFile = null
$this->outputFile = $outputFile ?: sys_get_temp_dir() . '/output.xml';
$this->executable = $executable;

if ($executor->execute($this->executable)) {
// If executor returns anything else than 0 (success exit code), throw an exeption since $executable is not executable.
if ($executor->execute($this->executable) !== 0) {
throw new \InvalidArgumentException(sprintf('`%s` is not executable.', $this->executable));
}
}
Expand Down

0 comments on commit a7a7a04

Please sign in to comment.