minor #15624 consistently use str_replace to unify directory separators (2.7) (Tobion)

This PR was merged into the 2.7 branch.

Discussion
----------

consistently use str_replace to unify directory separators (2.7)

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | -

Remaining ones from #15614

Commits
-------

17ce649 consistently use str_replace to unify directory separators (remaining)
This commit is contained in:
Fabien Potencier 2015-08-29 21:20:26 +02:00
commit 9d6fdc3b50
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ class SetAclCommandTest extends WebTestCase
$setAclCommandTester = new CommandTester($setAclCommand);
$setAclCommandTester->execute(array(
'command' => 'acl:set',
'arguments' => array($grantedPermission, sprintf('%s:%s', strtr(self::OBJECT_CLASS, '\\', '/'), $objectId)),
'arguments' => array($grantedPermission, sprintf('%s:%s', str_replace('\\', '/', self::OBJECT_CLASS), $objectId)),
'--role' => array($role),
));

View File

@ -120,7 +120,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
}
if (false === $name) {
$name = strtr($file, '\\', '/');
$name = str_replace('\\', '/', $file);
$name = substr($name, strrpos($name, '/') + 1);
}