Skip to content

Commit

Permalink
Avoid validating key paths before container compilation (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed Dec 5, 2016
1 parent 319502f commit 465c72a
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('private_key_path')
->defaultNull()
->validate()
->ifTrue($this->isPathInvalid())
->thenInvalid(self::INVALID_KEY_PATH)
->end()
->end()
->scalarNode('public_key_path')
->defaultNull()
->validate()
->ifTrue($this->isPathInvalid())
->thenInvalid(self::INVALID_KEY_PATH)
->end()
->end()
->scalarNode('pass_phrase')
->defaultValue('')
Expand Down Expand Up @@ -121,18 +113,4 @@ private function getTokenExtractorsNode()

return $node;
}

/**
* @return \Closure
*/
private function isPathInvalid()
{
return function ($path) {
if (null === $path) {
return;
}

return !is_file($path) || !is_readable($path);
};
}
}

0 comments on commit 465c72a

Please sign in to comment.