Skip to content

Commit d8f282e

Browse files
Various cleanups
1 parent 84081ad commit d8f282e

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/Symfony/Component/Console/Helper/ProcessHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ProcessHelper extends Helper
3838
public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
3939
{
4040
if (!class_exists(Process::class)) {
41-
throw new \LogicException('The Process helper requires the "Process" component. Install "symfony/process" to use it.');
41+
throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".');
4242
}
4343

4444
if ($output instanceof ConsoleOutputInterface) {

src/Symfony/Component/DependencyInjection/EnvVarProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
125125
$env = json_decode($env, true);
126126

127127
if (JSON_ERROR_NONE !== json_last_error()) {
128-
throw new RuntimeException(sprintf('Invalid JSON in env var "%s": '.json_last_error_msg(), $name));
128+
throw new RuntimeException(sprintf('Invalid JSON in env var "%s": ', $name)).json_last_error_msg();
129129
}
130130

131131
if (!\is_array($env)) {

src/Symfony/Component/Form/Resources/translations/validators.hu.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<trans-unit id="99">
1818
<source>This value is not a valid HTML5 color.</source>
1919
<target>Ez az érték nem egy érvényes HTML5 szín.</target>
20-
</trans-unit>
20+
</trans-unit>
2121
</body>
2222
</file>
2323
</xliff>

src/Symfony/Component/Intl/Data/Bundle/Reader/JsonBundleReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function read($path, $locale)
4646
$data = json_decode(file_get_contents($fileName), true);
4747

4848
if (null === $data) {
49-
throw new RuntimeException(sprintf('The resource bundle "%s" contains invalid JSON: '.json_last_error_msg(), $fileName));
49+
throw new RuntimeException(sprintf('The resource bundle "%s" contains invalid JSON: ', $fileName).json_last_error_msg());
5050
}
5151

5252
return $data;

src/Symfony/Component/Ldap/Adapter/ExtLdap/EntryManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function add(Entry $entry)
3838
$con = $this->getConnectionResource();
3939

4040
if (!@ldap_add($con, $entry->getDn(), $entry->getAttributes())) {
41-
throw new LdapException(sprintf('Could not add entry "%s": '.ldap_error($con), $entry->getDn()));
41+
throw new LdapException(sprintf('Could not add entry "%s": ', $entry->getDn()).ldap_error($con));
4242
}
4343

4444
return $this;
@@ -52,7 +52,7 @@ public function update(Entry $entry)
5252
$con = $this->getConnectionResource();
5353

5454
if (!@ldap_modify($con, $entry->getDn(), $entry->getAttributes())) {
55-
throw new LdapException(sprintf('Could not update entry "%s": '.ldap_error($con), $entry->getDn()));
55+
throw new LdapException(sprintf('Could not update entry "%s": ', $entry->getDn()).ldap_error($con));
5656
}
5757
}
5858

@@ -64,7 +64,7 @@ public function remove(Entry $entry)
6464
$con = $this->getConnectionResource();
6565

6666
if (!@ldap_delete($con, $entry->getDn())) {
67-
throw new LdapException(sprintf('Could not remove entry "%s": '.ldap_error($con), $entry->getDn()));
67+
throw new LdapException(sprintf('Could not remove entry "%s": ', $entry->getDn()).ldap_error($con));
6868
}
6969
}
7070

@@ -76,7 +76,7 @@ public function rename(Entry $entry, $newRdn, $removeOldRdn = true)
7676
$con = $this->getConnectionResource();
7777

7878
if (!@ldap_rename($con, $entry->getDn(), $newRdn, null, $removeOldRdn)) {
79-
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": '.ldap_error($con), $entry->getDn(), $newRdn));
79+
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": ', $entry->getDn(), $newRdn).ldap_error($con));
8080
}
8181
}
8282

src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
101101

102102
$dateTimeErrors = \DateTime::class === $type ? \DateTime::getLastErrors() : \DateTimeImmutable::getLastErrors();
103103

104-
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']))));
104+
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'])));
105105
}
106106

107107
try {

src/Symfony/Component/Translation/Loader/XliffFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function validateSchema($file, \DOMDocument $dom, $schema)
194194
if (!@$dom->schemaValidateSource($schema)) {
195195
libxml_disable_entity_loader($disableEntities);
196196

197-
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: '.implode("\n", $this->getXmlErrors($internalErrors)), $file));
197+
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: ', $file).implode("\n", $this->getXmlErrors($internalErrors)));
198198
}
199199

200200
libxml_disable_entity_loader($disableEntities);

0 commit comments

Comments
 (0)