Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
Conflicts:
	src/Propel/Generator/Builder/DataModelBuilder.php
  • Loading branch information
oojacoboo committed Dec 8, 2021
2 parents d371202 + a1a69bd commit 32ab619
Show file tree
Hide file tree
Showing 48 changed files with 220 additions and 187 deletions.
29 changes: 22 additions & 7 deletions phpstan-baseline.neon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ parameters:
- '%rootDir%/../../../src/Propel/Generator/Command/InitCommand.php'
ignoreErrors:
- '#Call to an undefined method .+Collection::.+Array\(\)#'
- '#Return type \(void\) of method .+CollectionIterator::.+\(\) should be compatible with return type \(bool\) of method ArrayIterator<\(int\|string\),mixed>::.+\(\)#'
-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder\\:\\:root\\(\\)\\.$#"
path: src/Propel/Common/Config/PropelConfiguration.php
2 changes: 1 addition & 1 deletion src/Propel/Common/Config/Loader/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function resolveParams(array $configuration): array
*
* @param string $file The resource
*
* @throws \Propel\Common\Config\Exception\InputOutputException If the path isnot readable
* @throws \Propel\Common\Config\Exception\InputOutputException If the path is not readable
*
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Propel/Common/Config/PropelConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected function addRuntimeSection(ArrayNodeDefinition $node)
->arrayNode('profiler')
->children()
->scalarNode('classname')->defaultValue('\Propel\Runtime\Util\Profiler')->end()
->floatNode('slowTreshold')->defaultValue(0.1)->end()
->floatNode('slowThreshold')->defaultValue(0.1)->end()
->arrayNode('details')
->children()
->arrayNode('time')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ protected function getForeignKey(): ForeignKey
// let's infer the relation from the foreign table
$fks = $foreignTable->getForeignKeysReferencingTable($this->getTable()->getName());
if (!$fks) {
$msg = 'You must define a foreign key from the \'%s\' table to the table witht the aggregated columns';
$msg = 'You must define a foreign key from the \'%s\' table to the table with the aggregated columns';
$this->throwInvalidArgumentExceptionWithLocation($msg, $foreignTable->getName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Warning: This termination methods issues 2n+1 queries.
*
* @param ConnectionInterface $con Connection to use.
* @param Boolean $useLittleMemory Whether or not to use OnDemandFormatter to retrieve objects.
* @param Boolean $useLittleMemory Whether to use OnDemandFormatter to retrieve objects.
* Set to false if the identity map matters.
* Set to true (default) to use less memory.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function addHasChildObject(&$script)
{
$script .= "
/**
* Whether or not this object is the parent of a child object
* Whether this object is the parent of a child object
*
* @return bool
*/
Expand Down
13 changes: 9 additions & 4 deletions src/Propel/Generator/Builder/DataModelBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Propel\Generator\Builder;

use BadMethodCallException;
use Propel\Common\Pluralizer\PluralizerInterface;
use Propel\Generator\Builder\Om\AbstractObjectBuilder;
use Propel\Generator\Builder\Om\AbstractOMBuilder;
Expand Down Expand Up @@ -449,10 +450,16 @@ public function setTable(Table $table)
/**
* Returns the current Table object.
*
* @throws \BadMethodCallException
*
* @return \Propel\Generator\Model\Table
*/
public function getTable()
{
if ($this->table === null) {
throw new BadMethodCallException('No $table set to return.');
}

return $this->table;
}

Expand All @@ -465,7 +472,7 @@ public function getPlatform()
{
if ($this->platform === null) {
// try to load the platform from the table
$table = $this->getTable();
$table = $this->table;
if ($table && $database = $table->getDatabase()) {
$this->setPlatform($database->getPlatform());
}
Expand Down Expand Up @@ -513,9 +520,7 @@ public function quoteIdentifier($text)
*/
public function getDatabase()
{
if ($this->getTable()) {
return $this->getTable()->getDatabase();
}
return $this->getTable()->getDatabase();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Propel/Generator/Builder/Om/ObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ protected function addBuildPkeyCriteriaComment(&$script)
* Builds a Criteria object containing the primary key for this object.
*
* Unlike buildCriteria() this method includes the primary key values regardless
* of whether or not they have been modified.
* of whether they have been modified.
*
* @throws LogicException if no primary key is defined
*
Expand Down
4 changes: 2 additions & 2 deletions src/Propel/Generator/Builder/Om/TableMapBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ protected function addGetOMClassInheritance(&$script)
*
* @param array \$row ConnectionInterface result row.
* @param int \$colnum Column to examine for OM class information (first is 0).
* @param boolean \$withPrefix Whether or not to return the path with the class name
* @param boolean \$withPrefix Whether to return the path with the class name
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*
Expand Down Expand Up @@ -1097,7 +1097,7 @@ protected function addGetOMClassNoInheritance(&$script)
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @param boolean \$withPrefix Whether or not to return the path with the class name
* @param boolean \$withPrefix Whether to return the path with the class name
* @return string path.to.ClassName
*/
public static function getOMClass(\$withPrefix = true)
Expand Down
2 changes: 1 addition & 1 deletion src/Propel/Generator/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function createDirectory($directory)
}

/**
* Parse a connection string and return an array with name, dsn and extra informations
* Parses a connection string and returns an array with name, DSN and extra information.
*
* @param string $connection The connection string
*
Expand Down
4 changes: 2 additions & 2 deletions src/Propel/Generator/Manager/AbstractManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ protected function loadDataModels()
}

/**
* Replaces all external-schema nodes with the content of xml schema that node refers to
* Replaces all external-schema nodes with the content of XML schema that node refers to
*
* Recurses to include any external schema referenced from in an included xml (and deeper)
* Recurses to include any external schema referenced from in an included XML (and deeper)
* Note: this function very much assumes at least a reasonable XML schema, maybe it'll proof
* users don't have those and adding some more informative exceptions would be better
*
Expand Down
6 changes: 3 additions & 3 deletions src/Propel/Generator/Model/Behavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function modifyTable()
}

/**
* Sets whether or not the table has been modified.
* Sets whether the table has been modified.
*
* @param bool $modified
*
Expand All @@ -329,7 +329,7 @@ public function setTableModified($modified)
}

/**
* Returns whether or not the table has been modified.
* Returns whether the table has been modified.
*
* @return bool
*/
Expand Down Expand Up @@ -466,7 +466,7 @@ public function getTableMapBuilderModifier()
}

/**
* Returns whether or not this behavior has additional builders.
* Returns whether this behavior has additional builders.
*
* @return bool
*/
Expand Down
Loading

0 comments on commit 32ab619

Please sign in to comment.