Skip to content

Commit

Permalink
minor #19405 Fixed bugs in names of classes and methods. (zomberg)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.7 branch (closes #19405).

Discussion
----------

Fixed bugs in names of classes and methods.

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

It's related to case sensitive.

I changed only calls of names of called methods but not definition of methods because BC.

Commits
-------

c41aa03 Fixed bugs in names of classes and methods.
  • Loading branch information
nicolas-grekas committed Jul 26, 2016
2 parents 0f07034 + c41aa03 commit b27b0a9
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 32 deletions.
Expand Up @@ -823,10 +823,10 @@ private function getValidatorMappingFiles(ContainerBuilder $container)

if (is_dir($dir = $dirname.'/Resources/config/validation')) {
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
$files[0][] = $file->getRealpath();
$files[0][] = $file->getRealPath();
}
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
$files[1][] = $file->getRealpath();
$files[1][] = $file->getRealPath();
}

$container->addResource(new DirectoryResource($dir));
Expand Down Expand Up @@ -944,13 +944,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder

if (is_dir($dir = $dirname.'/Resources/config/serialization')) {
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getRealpath()));
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getRealPath()));
$definition->setPublic(false);

$serializerLoaders[] = $definition;
}
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealpath()));
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealPath()));
$definition->setPublic(false);

$serializerLoaders[] = $definition;
Expand Down
Expand Up @@ -58,7 +58,7 @@ public function loadMessages($directory, MessageCatalogue $catalogue)
$extension = $catalogue->getLocale().'.'.$format;
$files = $finder->files()->name('*.'.$extension)->in($directory);
foreach ($files as $file) {
$domain = substr($file->getFileName(), 0, -1 * strlen($extension) - 1);
$domain = substr($file->getFilename(), 0, -1 * strlen($extension) - 1);
$catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Util/XmlUtils.php
Expand Up @@ -123,7 +123,7 @@ public static function loadFile($file, $schemaOrCallable = null)
*
* @return array A PHP array
*/
public static function convertDomElementToArray(\DomElement $element, $checkPrefix = true)
public static function convertDomElementToArray(\DOMElement $element, $checkPrefix = true)
{
$prefix = (string) $element->prefix;
$empty = true;
Expand Down
Expand Up @@ -66,7 +66,7 @@ protected function writePrompt(OutputInterface $output, Question $question)

break;

case $question instanceof ChoiceQuestion && $question->isMultiSelect():
case $question instanceof ChoiceQuestion && $question->isMultiselect():
$choices = $question->getChoices();
$default = explode(',', $default);

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Tests/ApplicationTest.php
Expand Up @@ -423,7 +423,7 @@ public function testFindAlternativeNamespace()
$application->add(new \FooCommand());
$application->add(new \Foo1Command());
$application->add(new \Foo2Command());
$application->add(new \foo3Command());
$application->add(new \Foo3Command());

try {
$application->find('Unknown-namespace:Unknown-command');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Debug/Tests/MockExceptionHandler.php
Expand Up @@ -13,7 +13,7 @@

use Symfony\Component\Debug\ExceptionHandler;

class MockExceptionHandler extends Exceptionhandler
class MockExceptionHandler extends ExceptionHandler
{
public $e;

Expand Down
Expand Up @@ -564,7 +564,7 @@ private function loadFromExtensions(\DOMDocument $xml)
*
* @return array A PHP array
*/
public static function convertDomElementToArray(\DomElement $element)
public static function convertDomElementToArray(\DOMElement $element)
{
return XmlUtils::convertDomElementToArray($element);
}
Expand Down
Expand Up @@ -100,7 +100,7 @@ public function provideInvalidParameters()
{
return array(
array(array('foo' => new Definition('stdClass'))),
array(array('foo' => new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")'))),
array(array('foo' => new Expression('service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")'))),
array(array('foo' => new Reference('foo'))),
array(array('foo' => new Variable('foo'))),
);
Expand Down
Expand Up @@ -50,7 +50,7 @@
->addMethodCall('setBar', array(new Reference('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)))
->addMethodCall('setBar', array(new Reference('foo3', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))
->addMethodCall('setBar', array(new Reference('foobaz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))
->addMethodCall('setBar', array(new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")')))
->addMethodCall('setBar', array(new Expression('service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")')))
;
$container
->register('foo_with_inline', 'Foo')
Expand Down
Expand Up @@ -248,7 +248,7 @@ protected function getMethodCall1Service()
if ($this->has('foobaz')) {
$instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE));
}
$instance->setBar(($this->get("foo")->foo() . (($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
$instance->setBar(($this->get("foo")->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));

return $instance;
}
Expand Down
Expand Up @@ -246,7 +246,7 @@ protected function getMethodCall1Service()

$instance->setBar($this->get('foo'));
$instance->setBar(NULL);
$instance->setBar(($this->get("foo")->foo() . (($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
$instance->setBar(($this->get("foo")->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));

return $instance;
}
Expand Down
Expand Up @@ -32,7 +32,7 @@
<service id="method_call1" class="FooClass">
<call method="setBar" />
<call method="setBar">
<argument type="expression">service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")</argument>
<argument type="expression">service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")</argument>
</call>
</service>
<service id="method_call2" class="FooClass">
Expand Down
Expand Up @@ -56,7 +56,7 @@
<argument type="service" id="foobaz" on-invalid="ignore"/>
</call>
<call method="setBar">
<argument type="expression">service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")</argument>
<argument type="expression">service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")</argument>
</call>
</service>
<service id="foo_with_inline" class="Foo">
Expand Down
Expand Up @@ -14,7 +14,7 @@ services:
calls:
- [ setBar, [] ]
- [ setBar ]
- [ setBar, ['@=service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")'] ]
- [ setBar, ['@=service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")'] ]
method_call2:
class: FooClass
calls:
Expand Down
Expand Up @@ -36,7 +36,7 @@ services:
- [setBar, ['@?foo2']]
- [setBar, ['@?foo3']]
- [setBar, ['@?foobaz']]
- [setBar, ['@=service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")']]
- [setBar, ['@=service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")']]

foo_with_inline:
class: Foo
Expand Down
Expand Up @@ -260,7 +260,7 @@ public function testLoadServices()
$this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array(array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals(array(array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals('factory', $services['new_factory1']->getFactory(), '->load() parses the factory tag');
$this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'getClass'), $services['new_factory2']->getFactory(), '->load() parses the factory tag');
Expand Down
Expand Up @@ -157,7 +157,7 @@ public function testLoadServices()
$this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array(new Reference('baz'), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array(array('setBar', array()), array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ (container.hasparameter("foo") ? parameter("foo") : "default")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals(array(array('setBar', array()), array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals('factory', $services['new_factory1']->getFactory(), '->load() parses the factory tag');
$this->assertEquals(array(new Reference('baz'), 'getClass'), $services['new_factory2']->getFactory(), '->load() parses the factory tag');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Finder/Tests/Shell/CommandTest.php
Expand Up @@ -148,7 +148,7 @@ public function testExecute()

$this->assertInternalType('array', $result);
$this->assertNotEmpty($result);
$this->assertRegexp('/PHP|HipHop/', $result[0]);
$this->assertRegExp('/PHP|HipHop/', $result[0]);
}

public function testCastToString()
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
Expand Up @@ -47,7 +47,7 @@ protected function tearDown()
parent::tearDown();
}

protected function assertXpathNodeValue(\DomElement $element, $expression, $nodeValue)
protected function assertXpathNodeValue(\DOMElement $element, $expression, $nodeValue)
{
$xpath = new \DOMXPath($element->ownerDocument);
$nodeList = $xpath->evaluate($expression);
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/Intl/Util/IntlTestHelper.php
Expand Up @@ -31,7 +31,7 @@ class IntlTestHelper
*
* @param \PhpUnit_Framework_TestCase $testCase
*/
public static function requireIntl(\PhpUnit_Framework_TestCase $testCase)
public static function requireIntl(\PHPUnit_Framework_TestCase $testCase)
{
// We only run tests if the version is *one specific version*.
// This condition is satisfied if
Expand Down Expand Up @@ -63,7 +63,7 @@ public static function requireIntl(\PhpUnit_Framework_TestCase $testCase)
*
* @param \PhpUnit_Framework_TestCase $testCase
*/
public static function requireFullIntl(\PhpUnit_Framework_TestCase $testCase)
public static function requireFullIntl(\PHPUnit_Framework_TestCase $testCase)
{
// We only run tests if the intl extension is loaded...
if (!Intl::isExtensionLoaded()) {
Expand Down Expand Up @@ -92,7 +92,7 @@ public static function requireFullIntl(\PhpUnit_Framework_TestCase $testCase)
*
* @param \PhpUnit_Framework_TestCase $testCase
*/
public static function require32Bit(\PhpUnit_Framework_TestCase $testCase)
public static function require32Bit(\PHPUnit_Framework_TestCase $testCase)
{
if (4 !== PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP 32 bit is required.');
Expand All @@ -104,7 +104,7 @@ public static function require32Bit(\PhpUnit_Framework_TestCase $testCase)
*
* @param \PhpUnit_Framework_TestCase $testCase
*/
public static function require64Bit(\PhpUnit_Framework_TestCase $testCase)
public static function require64Bit(\PHPUnit_Framework_TestCase $testCase)
{
if (8 !== PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP 64 bit is required.');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Tests/ProcessTest.php
Expand Up @@ -1229,7 +1229,7 @@ private function getProcess($commandline, $cwd = null, array $env = null, $input
} catch (RuntimeException $e) {
$this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage());
if ($enhance) {
$process->setEnhanceSigChildCompatibility(true);
$process->setEnhanceSigchildCompatibility(true);
} else {
self::$notEnhancedSigchild = true;
}
Expand Down
Expand Up @@ -37,7 +37,7 @@
$finder = new Finder();
$finder->name('*Platform.php')->in(dirname($reflection->getFileName()));
foreach ($finder as $file) {
require_once $file->getPathName();
require_once $file->getPathname();
$className = 'Doctrine\\DBAL\\Platforms\\'.$file->getBasename('.php');

$reflection = new ReflectionClass($className);
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Translation/DataCollectorTranslator.php
Expand Up @@ -124,14 +124,14 @@ private function collectMessage($locale, $domain, $id, $translation)
} elseif ($catalogue->has($id, $domain)) {
$state = self::MESSAGE_EQUALS_FALLBACK;

$fallbackCatalogue = $catalogue->getFallBackCatalogue();
$fallbackCatalogue = $catalogue->getFallbackCatalogue();
while ($fallbackCatalogue) {
if ($fallbackCatalogue->defines($id, $domain)) {
$locale = $fallbackCatalogue->getLocale();
break;
}

$fallbackCatalogue = $fallbackCatalogue->getFallBackCatalogue();
$fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue();
}
} else {
$state = self::MESSAGE_MISSING;
Expand Down
Expand Up @@ -44,7 +44,7 @@ public function validate($value, Constraint $constraint)
// the DateTime constructor:
// http://php.net/manual/en/datetime.formats.php
if (is_string($comparedValue)) {
if ($value instanceof \DatetimeImmutable) {
if ($value instanceof \DateTimeImmutable) {
// If $value is immutable, convert the compared value to a
// DateTimeImmutable too
$comparedValue = new \DatetimeImmutable($comparedValue);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/VarDumper/Caster/AmqpCaster.php
Expand Up @@ -131,7 +131,7 @@ public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, $isN
$prefix.'contentType' => $c->getContentType(),
$prefix.'contentEncoding' => $c->getContentEncoding(),
$prefix.'type' => $c->getType(),
$prefix.'timestamp' => $c->getTimestamp(),
$prefix.'timestamp' => $c->getTimeStamp(),
$prefix.'priority' => $c->getPriority(),
$prefix.'expiration' => $c->getExpiration(),
$prefix.'userId' => $c->getUserId(),
Expand Down

0 comments on commit b27b0a9

Please sign in to comment.