Skip to content

Commit 19ed440

Browse files
authored
Merge pull request #47 from mkopinsky/isSubclassOf_CS
Use correct case for calls to ReflectionClass::isSubclassOf
2 parents 5f8e0ae + 2320787 commit 19ed440

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

lib/Doctrine/Cli.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public function registerTaskClass($className)
359359
protected function classIsTask($className)
360360
{
361361
$reflectionClass = new ReflectionClass($className);
362-
return (bool) $reflectionClass->isSubClassOf(self::TASK_BASE_CLASS);
362+
return (bool) $reflectionClass->isSubclassOf(self::TASK_BASE_CLASS);
363363
}
364364

365365
/**

lib/Doctrine/Core.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ public static function isValidModelClass($class)
815815
// Skip the following classes
816816
// - abstract classes
817817
// - not a subclass of Doctrine_Record
818-
if ( ! $class->isAbstract() && $class->isSubClassOf('Doctrine_Record')) {
818+
if ( ! $class->isAbstract() && $class->isSubclassOf('Doctrine_Record')) {
819819

820820
return true;
821821
}

lib/Doctrine/Table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function initDefinition()
356356
}
357357
$ref = new ReflectionClass($parent);
358358

359-
if ($ref->isAbstract() || ! $class->isSubClassOf($parent)) {
359+
if ($ref->isAbstract() || ! $class->isSubclassOf($parent)) {
360360
continue;
361361
}
362362
$parentTable = $this->_conn->getTable($parent);

tests/Import/BuilderTestCase.php

+20-20
Original file line numberDiff line numberDiff line change
@@ -50,36 +50,36 @@ public function testInheritanceGeneration()
5050
$schemaTestInheritanceChild1Table = new ReflectionClass('SchemaTestInheritanceChild1Table');
5151
$schemaTestInheritanceChild2Table = new ReflectionClass('SchemaTestInheritanceChild2Table');
5252

53-
$this->assertTrue($schemaTestInheritanceParent->isSubClassOf('Doctrine_Record'));
54-
$this->assertTrue($schemaTestInheritanceParent->isSubClassOf('BaseSchemaTestInheritanceParent'));
55-
$this->assertTrue($schemaTestInheritanceParent->isSubClassOf('PackageSchemaTestInheritanceParent'));
56-
$this->assertTrue($schemaTestInheritanceChild1->isSubClassOf('BaseSchemaTestInheritanceChild1'));
57-
$this->assertTrue($schemaTestInheritanceChild2->isSubClassOf('BaseSchemaTestInheritanceChild2'));
53+
$this->assertTrue($schemaTestInheritanceParent->isSubclassOf('Doctrine_Record'));
54+
$this->assertTrue($schemaTestInheritanceParent->isSubclassOf('BaseSchemaTestInheritanceParent'));
55+
$this->assertTrue($schemaTestInheritanceParent->isSubclassOf('PackageSchemaTestInheritanceParent'));
56+
$this->assertTrue($schemaTestInheritanceChild1->isSubclassOf('BaseSchemaTestInheritanceChild1'));
57+
$this->assertTrue($schemaTestInheritanceChild2->isSubclassOf('BaseSchemaTestInheritanceChild2'));
5858

59-
$this->assertTrue($schemaTestInheritanceChild1->isSubClassOf('SchemaTestInheritanceParent'));
60-
$this->assertTrue($schemaTestInheritanceChild1->isSubClassOf('BaseSchemaTestInheritanceParent'));
59+
$this->assertTrue($schemaTestInheritanceChild1->isSubclassOf('SchemaTestInheritanceParent'));
60+
$this->assertTrue($schemaTestInheritanceChild1->isSubclassOf('BaseSchemaTestInheritanceParent'));
6161

62-
$this->assertTrue($schemaTestInheritanceChild2->isSubClassOf('SchemaTestInheritanceParent'));
63-
$this->assertTrue($schemaTestInheritanceChild2->isSubClassOf('BaseSchemaTestInheritanceParent'));
64-
$this->assertTrue($schemaTestInheritanceChild2->isSubClassOf('SchemaTestInheritanceChild1'));
65-
$this->assertTrue($schemaTestInheritanceChild2->isSubClassOf('BaseSchemaTestInheritanceChild1'));
66-
$this->assertTrue($schemaTestInheritanceChild2->isSubClassOf('PackageSchemaTestInheritanceParent'));
62+
$this->assertTrue($schemaTestInheritanceChild2->isSubclassOf('SchemaTestInheritanceParent'));
63+
$this->assertTrue($schemaTestInheritanceChild2->isSubclassOf('BaseSchemaTestInheritanceParent'));
64+
$this->assertTrue($schemaTestInheritanceChild2->isSubclassOf('SchemaTestInheritanceChild1'));
65+
$this->assertTrue($schemaTestInheritanceChild2->isSubclassOf('BaseSchemaTestInheritanceChild1'));
66+
$this->assertTrue($schemaTestInheritanceChild2->isSubclassOf('PackageSchemaTestInheritanceParent'));
6767

68-
$this->assertTrue($schemaTestInheritanceParentTable->isSubClassOf('Doctrine_Table'));
69-
$this->assertTrue($schemaTestInheritanceChild1Table->isSubClassOf('SchemaTestInheritanceParentTable'));
70-
$this->assertTrue($schemaTestInheritanceChild1Table->isSubClassOf('PackageSchemaTestInheritanceParentTable'));
68+
$this->assertTrue($schemaTestInheritanceParentTable->isSubclassOf('Doctrine_Table'));
69+
$this->assertTrue($schemaTestInheritanceChild1Table->isSubclassOf('SchemaTestInheritanceParentTable'));
70+
$this->assertTrue($schemaTestInheritanceChild1Table->isSubclassOf('PackageSchemaTestInheritanceParentTable'));
7171

72-
$this->assertTrue($schemaTestInheritanceChild2Table->isSubClassOf('SchemaTestInheritanceParentTable'));
73-
$this->assertTrue($schemaTestInheritanceChild2Table->isSubClassOf('PackageSchemaTestInheritanceParentTable'));
74-
$this->assertTrue($schemaTestInheritanceChild2Table->isSubClassOf('SchemaTestInheritanceChild1Table'));
75-
$this->assertTrue($schemaTestInheritanceChild2Table->isSubClassOf('PackageSchemaTestInheritanceChild1Table'));
72+
$this->assertTrue($schemaTestInheritanceChild2Table->isSubclassOf('SchemaTestInheritanceParentTable'));
73+
$this->assertTrue($schemaTestInheritanceChild2Table->isSubclassOf('PackageSchemaTestInheritanceParentTable'));
74+
$this->assertTrue($schemaTestInheritanceChild2Table->isSubclassOf('SchemaTestInheritanceChild1Table'));
75+
$this->assertTrue($schemaTestInheritanceChild2Table->isSubclassOf('PackageSchemaTestInheritanceChild1Table'));
7676

7777
# Simple Inheritance
7878
$schemaTestSimpleInheritanceParent = new ReflectionClass('SchemaTestSimpleInheritanceParent');
7979
$schemaTestSimpleInheritanceChild = new ReflectionClass('SchemaTestSimpleInheritanceChild');
8080

8181
$this->assertTrue($schemaTestSimpleInheritanceParent->hasMethod('setTableDefinition'));
82-
$this->assertTrue($schemaTestSimpleInheritanceChild->isSubClassOf('SchemaTestSimpleInheritanceParent'));
82+
$this->assertTrue($schemaTestSimpleInheritanceChild->isSubclassOf('SchemaTestSimpleInheritanceParent'));
8383

8484
# Class Table Inheritance
8585
$schemaTestClassTableInheritanceParent = new ReflectionClass('SchemaTestClassTableInheritanceParent');

0 commit comments

Comments
 (0)