PMCORE-3920 Create a PM table or Report Table are not working

This commit is contained in:
Roly Gutierrez
2022-08-17 09:19:35 -04:00
parent 2427b40a74
commit 73fc20af00
9 changed files with 42 additions and 18 deletions

View File

@@ -221,7 +221,7 @@ class IntrospectionHelper {
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
if (($hint = $this->getClass($params[0])) !== null) {
$classname = $hint->getName();
}
@@ -249,7 +249,7 @@ class IntrospectionHelper {
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
if (($hint = $this->getClass($params[0])) !== null) {
$classname = $hint->getName();
}
@@ -325,8 +325,8 @@ class IntrospectionHelper {
$params = $method->getParameters();
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
if (($hint = $this->getClass($params[0])) !== null) {
$classname = $hint->getName();
}
@@ -412,7 +412,7 @@ class IntrospectionHelper {
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
if (($hint = $this->getClass($params[0])) !== null) {
$classname = $hint->getName();
}
@@ -539,4 +539,17 @@ class IntrospectionHelper {
}
}
/**
* Get class
* @param object $param
* @return mixed
*/
private function getClass(object $param)
{
$name = null;
if ($param->getType() && !$param->getType()->isBuiltin()) {
$name = new ReflectionClass($param->getType()->getName());
}
return $name;
}
}

View File

@@ -29,7 +29,7 @@ include_once 'phing/BuildEvent.php';
* any messages that get logged.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright <EFBFBD> 2001,2002 THYRELL. All rights reserved
* @copyright © 2001,2002 THYRELL. All rights reserved
* @version $Revision: 1.11 $ $Date: 2005/08/25 19:33:43 $
* @see BuildEvent
* @package phing.listener
@@ -214,7 +214,7 @@ class DefaultLogger implements BuildListener {
$minutes, ($minutes === 1 ? " " : "s "),
$seconds - floor($seconds/60) * 60, ($seconds%60 === 1 ? "" : "s"));
} else {
return sprintf("%0.4f second%s", $seconds, ($seconds%60 === 1 ? "" : "s"));
return sprintf("%0.4f second%s", $seconds, ((int) $seconds % 60 === 1 ? "" : "s"));
}
}

View File

@@ -215,7 +215,10 @@ class Properties {
* @return mixed Old property value or NULL if none was set.
*/
function setProperty($key, $value) {
$oldValue = @$this->properties[$key];
$oldValue = null;
if (array_key_exists($key, $this->properties)) {
$oldValue = $this->properties[$key];
}
$this->properties[$key] = $value;
return $oldValue;
}

View File

@@ -31,7 +31,7 @@ include_once 'phing/tasks/system/condition/Condition.php';
*
* @author Hans Lellelid <hans@xmpl.org>
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright <EFBFBD> 2001,2002 THYRELL. All rights reserved
* @copyright © 2001,2002 THYRELL. All rights reserved
* @version $Revision: 1.16 $
* @package phing.tasks.system.condition
*/
@@ -46,7 +46,7 @@ abstract class ConditionBase extends ProjectComponent implements IteratorAggrega
/**
* Required for IteratorAggregate
*/
function getIterator() {
function getIterator(): \Traversable {
return new ConditionEnumeration($this);
}
@@ -169,7 +169,7 @@ class ConditionEnumeration implements Iterator {
$this->outer = $outer;
}
public function valid() {
public function valid(): bool {
return $this->outer->countConditions() > $this->num;
}
@@ -181,7 +181,7 @@ class ConditionEnumeration implements Iterator {
return $o;
}
function next() {
function next(): void {
$this->num++;
}
@@ -189,7 +189,7 @@ class ConditionEnumeration implements Iterator {
return $this->num;
}
function rewind() {
function rewind(): void {
$this->num = 0;
}
}

View File

@@ -167,7 +167,7 @@ class StringHelper {
* a natural way of getting a subtring, php's circular string buffer and strange
* return values suck if you want to program strict as of C or friends
*/
public static function substring($string, $startpos, $endpos = -1) {
public static function substring(string $string, $startpos, $endpos = -1) {
$len = strlen($string);
$endpos = (int) (($endpos === -1) ? $len-1 : $endpos);
if ($startpos > $len-1 || $startpos < 0) {

View File

@@ -148,7 +148,11 @@ CREATE TABLE ".$this->quoteIdentifier($table->getName())."
// $script .= " DEFAULT CHARSET='". $platform->escapeText( $vendorSpecific['Collation'] )."'";
$script .= " DEFAULT CHARSET='utf8'";
}
if($vendorSpecific['Comment'] ) {
$value = null;
if (array_key_exists('Comment', $vendorSpecific)) {
$value = $vendorSpecific['Comment'];
}
if($value) {
$script .= " COMMENT='". $platform->escapeText( $vendorSpecific['Comment'] )."'";
}
// if($table->getDescription()) {

View File

@@ -81,6 +81,7 @@ abstract class XMLElement {
if (is_numeric($val)) {
return (bool) $val;
} else {
$val = is_null($val) ? '' : $val;
return (in_array(strtolower($val), array('true', 't', 'y', 'yes'), true) ? true : false);
}
}

View File

@@ -72,7 +72,9 @@ class MysqlPlatform extends DefaultPlatform {
$usingInnoDB = false;
if(class_exists('DataModelBuilder', false))
{
$usingInnoDB = strtolower(DataModelBuilder::getBuildProperty('mysqlTableType')) == 'innodb';
$val = DataModelBuilder::getBuildProperty('mysqlTableType');
$val = is_null($val) ? '' : $val;
$usingInnoDB = strtolower($val) == 'innodb';
}
return $usingInnoDB || false;
}