Various cleanups
This commit is contained in:
parent
84081adbf7
commit
d8f282edca
@ -38,7 +38,7 @@ class ProcessHelper extends Helper
|
||||
public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
|
||||
{
|
||||
if (!class_exists(Process::class)) {
|
||||
throw new \LogicException('The Process helper requires the "Process" component. Install "symfony/process" to use it.');
|
||||
throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".');
|
||||
}
|
||||
|
||||
if ($output instanceof ConsoleOutputInterface) {
|
||||
|
@ -125,7 +125,7 @@ class EnvVarProcessor implements EnvVarProcessorInterface
|
||||
$env = json_decode($env, true);
|
||||
|
||||
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||
throw new RuntimeException(sprintf('Invalid JSON in env var "%s": '.json_last_error_msg(), $name));
|
||||
throw new RuntimeException(sprintf('Invalid JSON in env var "%s": ', $name)).json_last_error_msg();
|
||||
}
|
||||
|
||||
if (!\is_array($env)) {
|
||||
|
@ -46,7 +46,7 @@ class JsonBundleReader implements BundleReaderInterface
|
||||
$data = json_decode(file_get_contents($fileName), true);
|
||||
|
||||
if (null === $data) {
|
||||
throw new RuntimeException(sprintf('The resource bundle "%s" contains invalid JSON: '.json_last_error_msg(), $fileName));
|
||||
throw new RuntimeException(sprintf('The resource bundle "%s" contains invalid JSON: ', $fileName).json_last_error_msg());
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
@ -38,7 +38,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
|
||||
$con = $this->getConnectionResource();
|
||||
|
||||
if (!@ldap_add($con, $entry->getDn(), $entry->getAttributes())) {
|
||||
throw new LdapException(sprintf('Could not add entry "%s": '.ldap_error($con), $entry->getDn()));
|
||||
throw new LdapException(sprintf('Could not add entry "%s": ', $entry->getDn()).ldap_error($con));
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -52,7 +52,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
|
||||
$con = $this->getConnectionResource();
|
||||
|
||||
if (!@ldap_modify($con, $entry->getDn(), $entry->getAttributes())) {
|
||||
throw new LdapException(sprintf('Could not update entry "%s": '.ldap_error($con), $entry->getDn()));
|
||||
throw new LdapException(sprintf('Could not update entry "%s": ', $entry->getDn()).ldap_error($con));
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
|
||||
$con = $this->getConnectionResource();
|
||||
|
||||
if (!@ldap_delete($con, $entry->getDn())) {
|
||||
throw new LdapException(sprintf('Could not remove entry "%s": '.ldap_error($con), $entry->getDn()));
|
||||
throw new LdapException(sprintf('Could not remove entry "%s": ', $entry->getDn()).ldap_error($con));
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
|
||||
$con = $this->getConnectionResource();
|
||||
|
||||
if (!@ldap_rename($con, $entry->getDn(), $newRdn, null, $removeOldRdn)) {
|
||||
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": '.ldap_error($con), $entry->getDn(), $newRdn));
|
||||
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": ', $entry->getDn(), $newRdn).ldap_error($con));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ class DateTimeNormalizer implements NormalizerInterface, DenormalizerInterface
|
||||
|
||||
$dateTimeErrors = \DateTime::class === $type ? \DateTime::getLastErrors() : \DateTimeImmutable::getLastErrors();
|
||||
|
||||
throw new NotNormalizableValueException(sprintf('Parsing datetime string "%s" using format "%s" resulted in %d errors:.'."\n".'%s', $data, $dateTimeFormat, $dateTimeErrors['error_count'], implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors']))));
|
||||
throw new NotNormalizableValueException(sprintf('Parsing datetime string "%s" using format "%s" resulted in %d errors: ', $data, $dateTimeFormat, $dateTimeErrors['error_count'])."\n".implode("\n", $this->formatDateTimeErrors($dateTimeErrors['errors'])));
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -194,7 +194,7 @@ class XliffFileLoader implements LoaderInterface
|
||||
if (!@$dom->schemaValidateSource($schema)) {
|
||||
libxml_disable_entity_loader($disableEntities);
|
||||
|
||||
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: '.implode("\n", $this->getXmlErrors($internalErrors)), $file));
|
||||
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: ', $file).implode("\n", $this->getXmlErrors($internalErrors)));
|
||||
}
|
||||
|
||||
libxml_disable_entity_loader($disableEntities);
|
||||
|
Reference in New Issue
Block a user