Skip to content

Commit

Permalink
Fix more docblocks and missing return type docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Jul 23, 2020
1 parent e420d21 commit 40305f8
Show file tree
Hide file tree
Showing 26 changed files with 177 additions and 60 deletions.
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ includes:
- phpstan-baseline.neon
parameters:
level: 5
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
paths:
- '%rootDir%/../../../src/'
excludes_analyse:
Expand Down
8 changes: 7 additions & 1 deletion src/Propel/Common/Config/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function getConnectionParametersArray($section = 'runtime')
*
* @param string|null $fileName Configuration file name or directory in which resides the configuration file.
* @param array|null $extraConf Array of configuration properties, to be merged with those loaded from file.
* @return void
*/
protected function load($fileName, $extraConf)
{
Expand Down Expand Up @@ -180,11 +181,12 @@ protected function load($fileName, $extraConf)
* @param array $extraConf Extra configuration to merge before processing. It's useful when a child class overwrite
* the constructor to pass a built-in array of configuration, without load it from file. I.e.
* Propel\Generator\Config\QuickGeneratorConfig class.
* @return void
*/
protected function process($extraConf = null)
{
if (null === $extraConf && count($this->config) <= 0) {
return null;
return;
}

$processor = new Processor();
Expand Down Expand Up @@ -278,6 +280,8 @@ private function getDirs($fileName)

/**
* Remove empty `slaves` array from configured connections.
*
* @return void
*/
private function cleanupSlaveConnections()
{
Expand All @@ -291,6 +295,8 @@ private function cleanupSlaveConnections()
/**
* If not defined, set `runtime` and `generator` connections, based on `database.connections` property.
* Check if runtime and generator connections are correctly defined.
*
* @return void
*/
private function cleanupConnections()
{
Expand Down
7 changes: 4 additions & 3 deletions src/Propel/Common/Config/Loader/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class FileLoader extends BaseFileLoader
/**
* Constructor.
*
* @param FileLocatorInterface $locator A FileLocator instance
* @param FileLocatorInterface|null $locator A FileLocator instance
*/
public function __construct(FileLocatorInterface $locator = null)
{
Expand All @@ -61,11 +61,12 @@ public function __construct(FileLocatorInterface $locator = null)
* Replaces parameter placeholders (%name%) by their values for all parameters.
*
* @param array $configuration The configuration array to resolve
* @return array|null
*/
public function resolveParams(array $configuration)
{
if ($this->resolved) {
return;
return null;
}

$this->config = $configuration;
Expand All @@ -84,7 +85,7 @@ public function resolveParams(array $configuration)
/**
* Get the pathof a given resource
*
* @param mixed $file The resource
* @param string $file The resource
*
* @return array|string
* @throws \InvalidArgumentException If the file is not found
Expand Down
6 changes: 2 additions & 4 deletions src/Propel/Common/Config/Loader/IniFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ public function supports($resource, $type = null)
/**
* Loads a resource, merge it with the default configuration array and resolve its parameters.
*
* @param mixed $file The resource
* @param string $type The resource type
* @param string $file The resource
* @param string|null $type The resource type
* @return array The configuration array
*
* @return array
*
* @throws \InvalidArgumentException if configuration file not found
* @throws \Propel\Common\Config\Exception\InvalidArgumentException When ini file is not valid
* @throws \Propel\Common\Config\Exception\InputOutputException if configuration file is not readable
Expand Down
4 changes: 2 additions & 2 deletions src/Propel/Common/Config/Loader/JsonFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class JsonFileLoader extends FileLoader
/**
* Loads an Json file.
*
* @param mixed $file The resource
* @param string $type The resource type
* @param string $file The resource
* @param string|null $type The resource type
*
* @return array
*
Expand Down
4 changes: 2 additions & 2 deletions src/Propel/Common/Config/Loader/PhpFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class PhpFileLoader extends FileLoader
/**
* Loads a PHP file.
*
* @param mixed $file The resource
* @param string $type The resource type
* @param string $file The resource
* @param string|null $type The resource type
*
* @return array
*
Expand Down
4 changes: 2 additions & 2 deletions src/Propel/Common/Config/Loader/XmlFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class XmlFileLoader extends FileLoader
/**
* Loads an Xml file.
*
* @param mixed $file The resource
* @param string $type The resource type
* @param string $file The resource
* @param string|null $type The resource type
*
* @return array
*
Expand Down
4 changes: 2 additions & 2 deletions src/Propel/Common/Config/Loader/YamlFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class YamlFileLoader extends FileLoader
/**
* Loads a Yaml file.
*
* @param mixed $file The resource
* @param string $type The resource type
* @param string $file The resource
* @param string|null $type The resource type
*
* @return array
*
Expand Down
8 changes: 7 additions & 1 deletion src/Propel/Generator/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

class Application extends \Symfony\Component\Console\Application
{
/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*
* @return int
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
if (extension_loaded('xdebug')) {
Expand All @@ -16,4 +22,4 @@ public function doRun(InputInterface $input, OutputInterface $output)
}
return parent::doRun($input, $output);
}
}
}
1 change: 1 addition & 0 deletions src/Propel/Generator/Builder/Om/AbstractOMBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ abstract protected function addClassOpen(&$script);
* drastically change the contents of the generated object class.
*
* @param string $script The script will be modified in this method.
* @return void
*/
abstract protected function addClassBody(&$script);

Expand Down
2 changes: 2 additions & 0 deletions src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ abstract class AbstractObjectBuilder extends AbstractOMBuilder
* This is here because it is probably generic enough to apply to templates being generated
* in different PHP versions.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addColumnAccessorMethods(&$script)
{
Expand Down Expand Up @@ -75,6 +76,7 @@ protected function addColumnAccessorMethods(&$script)
* This is here because it is probably generic enough to apply to templates being generated
* in different PHP versions.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addColumnMutatorMethods(&$script)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Propel/Generator/Builder/Om/ExtensionObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function getUnprefixedClassName()
/**
* Adds class phpdoc comment and opening of class.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addClassOpen(&$script)
{
Expand Down Expand Up @@ -82,6 +83,7 @@ protected function addClassBody(&$script)
/**
* Closes class.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addClassClose(&$script)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Propel/Generator/Builder/Om/ExtensionQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function getUnprefixedClassName()
/**
* Adds class phpdoc comment and opening of class.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addClassOpen(&$script)
{
Expand Down Expand Up @@ -84,6 +85,7 @@ protected function addClassBody(&$script)
/**
* Closes class.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addClassClose(&$script)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Propel/Generator/Builder/Om/InterfaceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function getUnprefixedClassName()
* Adds class phpdoc comment and opening of class.
*
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addClassOpen(&$script)
{
Expand Down Expand Up @@ -81,6 +82,7 @@ protected function addClassBody(&$script)
/**
* Closes class.
* @param string $script The script will be modified in this method.
* @return void
*/
protected function addClassClose(&$script)
{
Expand Down
Loading

0 comments on commit 40305f8

Please sign in to comment.