Skip to content

Commit

Permalink
Merge pull request phalcon#1129 from phalcon/3.2.x
Browse files Browse the repository at this point in the history
3.2.8
  • Loading branch information
sergeyklay authored Oct 20, 2017
2 parents 018605a + 944e8d6 commit c77ddde
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ script:
- vendor/bin/codecept run unit -v
- vendor/bin/codecept run functional -v
- vendor/bin/codecept run console -v
- '[[ "$PHP_MAJOR" == "5" ]] || vendor/bin/phpstan analyse -l 1 -c phpstan.neon scripts -vvv'
- '[[ "$PHP_MAJOR" == "5" ]] || vendor/bin/phpstan analyse -l 5 -c phpstan.neon scripts -vvv'

notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ This command should display something similar to:
```sh
$ phalcon --help

Phalcon DevTools (3.2.7)
Phalcon DevTools (3.2.8)

Help:
Lists the commands available in Phalcon devtools
Expand Down
4 changes: 2 additions & 2 deletions scripts/Phalcon/Builder/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public function build()

if (!$controllersDir = $this->options->get('controllersDir')) {
$config = $this->getConfig();
if (!isset($config->application->controllersDir)) {
if (empty($config->path('application.controllersDir'))) {
throw new BuilderException('Please specify a controller directory.');
}

$controllersDir = $config->application->controllersDir;
$controllersDir = $config->path('application.controllersDir');
}

if (!$this->options->contains('name')) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Builder/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Project extends Component

/**
* Current Project Type
* @var null
* @var string
*/
private $currentType = self::TYPE_SIMPLE;

Expand Down
132 changes: 66 additions & 66 deletions scripts/Phalcon/Builder/Scaffold.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions scripts/Phalcon/Commands/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public function getOption($option, $filters = null, $defaultValue = null)
/**
* Indicates whether the script was a particular option.
*
* @param string $option
* @param string | string[] $option
* @return boolean
*/
public function isReceivedOption($option)
Expand Down Expand Up @@ -458,7 +458,7 @@ protected function filter($paramValue, $filters)
/**
* Gets the last parameter is not associated with any parameter name.
*
* @return string
* @return string | bool
*/
public function getLastUnNamedParam()
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Db/Adapter/Pdo/PostgresqlExtended.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PostgresqlExtended extends Postgresql
*
* @param string $table
* @param string $schema
* @return Reference
* @return ReferenceInterface[]
*
*/
public function describeReferences($table, $schema = NULL)
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Devtools/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class Version extends PhVersion
*/
protected static function _getVersion()
{
return [3, 2, 7, 4, 0];
return [3, 2, 8, 4, 0];
}
}
2 changes: 1 addition & 1 deletion scripts/Phalcon/Error/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function handle(AppError $error)
* Maps error code to a string.
*
* @param integer $code
* @return string
* @return mixed
*/
public function mapErrors($code)
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/Phalcon/Initializable.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ function () {
/** @noinspection PhpIncludeInspection */
$menu = new SidebarMenu(include $menuItems);

$menu->setDI($this);
$menu->setDI($this->di);

return $menu;
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/Phalcon/Migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public static function addCurrentVersion($options, $version, $startTime = null)
$connection->insert(self::MIGRATION_LOG_TABLE, [$version, $startTime, $endTime], ['version', 'start_time', 'end_time']);
} else {
$currentVersions = self::getCompletedVersions($options);
$currentVersions[(string)$version] = 1;
$currentVersions[$version] = 1;
$currentVersions = array_keys($currentVersions);
sort($currentVersions);
file_put_contents(self::$_storage, implode("\n", $currentVersions));
Expand All @@ -558,7 +558,7 @@ public static function removeCurrentVersion($options, $version)
$connection->execute('DELETE FROM '. self::MIGRATION_LOG_TABLE .' WHERE version=\'' . $version . '\'');
} else {
$currentVersions = self::getCompletedVersions($options);
unset($currentVersions[(string)$version]);
unset($currentVersions[$version]);
$currentVersions = array_keys($currentVersions);
sort($currentVersions);
file_put_contents(self::$_storage, implode("\n", $currentVersions));
Expand Down
9 changes: 7 additions & 2 deletions scripts/Phalcon/Mvc/Model/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
*
* Migrations of DML y DDL over databases
* @method afterCreateTable()
* @method morph()
* @method up()
* @method afterUp()
* @method down()
* @method afterDown()
*
* @package Phalcon\Mvc\Model
*/
Expand Down Expand Up @@ -148,7 +153,7 @@ public static function setup($database, $verbose = false)
/**
* Set the skip auto increment value
*
* @param string $skip
* @param bool $skip
*/
public static function setSkipAutoIncrement($skip)
{
Expand Down Expand Up @@ -300,7 +305,7 @@ public static function generate(ItemInterface $version, $table, $exportData = nu
$fieldDefinition[] = "'autoIncrement' => true";
}

if (self::$_databaseConfig->adapter == 'Postgresql' &&
if (self::$_databaseConfig->path('adapter') == 'Postgresql' &&
in_array($field->getType(), [Column::TYPE_BOOLEAN, Column::TYPE_INTEGER, Column::TYPE_BIGINTEGER])
) {
// nothing
Expand Down
10 changes: 5 additions & 5 deletions scripts/Phalcon/Version/IncrementalItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class IncrementalItem implements ItemInterface
private $_version;

/**
* @var int|string
* @var int | string
*/
private $_versionStamp = 0;

Expand Down Expand Up @@ -113,7 +113,7 @@ public static function sortDesc($versions)
/**
* @param $versions ItemInterface[]
*
* @return ItemInterface
* @return null | IncrementalItem
*/
public static function maximum($versions)
{
Expand Down Expand Up @@ -169,17 +169,17 @@ public static function between($initialVersion, $finalVersion, $versions)
}

/**
* @return int|string
* @return int | string
*/
public function getStamp()
{
return $this->_versionStamp;
}

/**
* @param $number
* @param int $number
*
* @return string
* @return IncrementalItem
*/
public function addMinor($number)
{
Expand Down
19 changes: 4 additions & 15 deletions scripts/Phalcon/Version/ItemCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static function sortDesc(array $versions)
*
* @param array $versions
*
* @return null|ItemInterface
* @return null | ItemInterface | IncrementalItem
*/
public static function maximum(array $versions)
{
Expand All @@ -160,23 +160,12 @@ public static function maximum(array $versions)
* @param ItemInterface $finalVersion
* @param ItemInterface[] $versions
*
* @return ItemInterface[]|array
* @return ItemInterface[] | array
*/
public static function between(
ItemInterface $initialVersion,
ItemInterface $finalVersion,
array $versions
) {
public static function between(ItemInterface $initialVersion, ItemInterface $finalVersion, array $versions)
{
$versions = self::sortAsc($versions);

if (!is_object($initialVersion)) {
$initialVersion = self::createItem($initialVersion);
}

if (!is_object($finalVersion)) {
$finalVersion = self::createItem($finalVersion);
}

$betweenVersions = array();
if ($initialVersion->getStamp() == $finalVersion->getStamp()) {
return $betweenVersions; // nothing to do
Expand Down

0 comments on commit c77ddde

Please sign in to comment.