Skip to content

Commit b5d57ed

Browse files
committed
Method now always expects strings (ref #1581)
1 parent 2a4978e commit b5d57ed

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Util/Standards.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,21 @@ public static function isInstalledStandard($standard)
255255
* CodeSniffer/Standards directory. Valid coding standards
256256
* include a ruleset.xml file.
257257
*
258-
* @param string|\SimpleXMLElement $standard The name of the coding standard.
258+
* @param string $standard The name of the coding standard.
259259
*
260260
* @return string|null
261261
*/
262262
public static function getInstalledStandardPath($standard)
263263
{
264-
$installedPaths = self::getInstalledStandardPaths();
265-
$standard = (string) $standard;
266-
267264
if (strpos($standard, '.') !== false) {
268265
return null;
269266
}
270267

268+
$installedPaths = self::getInstalledStandardPaths();
271269
foreach ($installedPaths as $installedPath) {
272270
$standardPath = $installedPath.DIRECTORY_SEPARATOR.$standard;
273271
if (file_exists($standardPath) === false) {
274-
if (basename($installedPath) !== (string) $standard) {
272+
if (basename($installedPath) !== $standard) {
275273
continue;
276274
}
277275

0 commit comments

Comments
 (0)