Remove these as they break PHP 7.0
Doesn't just break PHP 5.6 it also breaks PHP 7.0
This commit is contained in:
parent
acf3781bd3
commit
d3ee256286
|
|
@ -543,7 +543,7 @@
|
||||||
* @return array tables
|
* @return array tables
|
||||||
* @depends connect()
|
* @depends connect()
|
||||||
*/
|
*/
|
||||||
public function tables() : array {
|
public function tables() {
|
||||||
$result = [];
|
$result = [];
|
||||||
//connect to the database if needed
|
//connect to the database if needed
|
||||||
if (!$this->db) {
|
if (!$this->db) {
|
||||||
|
|
@ -593,7 +593,7 @@
|
||||||
* @return array table info
|
* @return array table info
|
||||||
* @depends connect()
|
* @depends connect()
|
||||||
*/
|
*/
|
||||||
public function table_info() : array {
|
public function table_info() {
|
||||||
//public $db;
|
//public $db;
|
||||||
//public $type;
|
//public $type;
|
||||||
//public $table;
|
//public $table;
|
||||||
|
|
@ -644,7 +644,7 @@
|
||||||
* @return boolean Returns <i>true</i> if the table exists and <i>false</i> if it does not.
|
* @return boolean Returns <i>true</i> if the table exists and <i>false</i> if it does not.
|
||||||
* @depends connect()
|
* @depends connect()
|
||||||
*/
|
*/
|
||||||
public function table_exists ($table_name) : bool {
|
public function table_exists ($table_name) {
|
||||||
if (self::sanitize($table_name) != $table_name) {
|
if (self::sanitize($table_name) != $table_name) {
|
||||||
trigger_error('Table Name must be sanitized', E_USER_WARNING);
|
trigger_error('Table Name must be sanitized', E_USER_WARNING);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -683,7 +683,7 @@
|
||||||
* @return array Two dimensional array
|
* @return array Two dimensional array
|
||||||
* @depends table_info()
|
* @depends table_info()
|
||||||
*/
|
*/
|
||||||
public function fields() : array {
|
public function fields() {
|
||||||
//public $db;
|
//public $db;
|
||||||
//public $type;
|
//public $type;
|
||||||
//public $table;
|
//public $table;
|
||||||
|
|
@ -1407,7 +1407,7 @@
|
||||||
* Counts the number of rows.
|
* Counts the number of rows.
|
||||||
* @return int Represents the number of counted rows or -1 if failed.
|
* @return int Represents the number of counted rows or -1 if failed.
|
||||||
*/
|
*/
|
||||||
public function count() : int {
|
public function count() {
|
||||||
|
|
||||||
//connect to the database if needed
|
//connect to the database if needed
|
||||||
if (!$this->db) {
|
if (!$this->db) {
|
||||||
|
|
@ -1543,7 +1543,7 @@
|
||||||
* @param array $array Array containing the table name, uuid, SQL and where clause.
|
* @param array $array Array containing the table name, uuid, SQL and where clause.
|
||||||
* @return database Returns the database object or null.
|
* @return database Returns the database object or null.
|
||||||
*/
|
*/
|
||||||
public function find_new(array $array): ?database {
|
public function find_new(array $array) {
|
||||||
|
|
||||||
//connect to the database if needed
|
//connect to the database if needed
|
||||||
if (!$this->db) {
|
if (!$this->db) {
|
||||||
|
|
@ -1650,7 +1650,7 @@
|
||||||
* @param string $uuid A valid UUID must be passed
|
* @param string $uuid A valid UUID must be passed
|
||||||
* @return database Returns this object
|
* @return database Returns this object
|
||||||
*/
|
*/
|
||||||
public function uuid(string $uuid) : database {
|
public function uuid(string $uuid) {
|
||||||
$this->uuid = $uuid;
|
$this->uuid = $uuid;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
@ -1660,7 +1660,7 @@
|
||||||
* @param array $array Three dimensional Array. The first dimension is the table name without the prefix 'v_'. Second dimension in the row value as int. Third dimension is the column name.
|
* @param array $array Three dimensional Array. The first dimension is the table name without the prefix 'v_'. Second dimension in the row value as int. Third dimension is the column name.
|
||||||
* @return bool Returns <b>true</b> on success and <b>false</b> on failure.
|
* @return bool Returns <b>true</b> on success and <b>false</b> on failure.
|
||||||
*/
|
*/
|
||||||
public function copy(array $array, $suffix = '(Copy)') : bool {
|
public function copy(array $array, $suffix = '(Copy)') {
|
||||||
//set default return value
|
//set default return value
|
||||||
$retval = false;
|
$retval = false;
|
||||||
|
|
||||||
|
|
@ -1876,7 +1876,7 @@
|
||||||
* @depends database::save()
|
* @depends database::save()
|
||||||
* @depends database::get_apps()
|
* @depends database::get_apps()
|
||||||
*/
|
*/
|
||||||
public function toggle(array $array) : bool {
|
public function toggle(array $array) {
|
||||||
|
|
||||||
//return the array
|
//return the array
|
||||||
if (!is_array($array)) { return false; }
|
if (!is_array($array)) { return false; }
|
||||||
|
|
@ -2001,7 +2001,7 @@
|
||||||
* @param bool $transaction_save
|
* @param bool $transaction_save
|
||||||
* @return boolean Returns <b>true</b> on success and <b>false</b> on failure of one or more failed write attempts.
|
* @return boolean Returns <b>true</b> on success and <b>false</b> on failure of one or more failed write attempts.
|
||||||
*/
|
*/
|
||||||
public function save(array &$array, bool $transaction_save = true) : bool {
|
public function save(array &$array, bool $transaction_save = true) {
|
||||||
//set default return value
|
//set default return value
|
||||||
$retval = true;
|
$retval = true;
|
||||||
|
|
||||||
|
|
@ -2802,7 +2802,7 @@
|
||||||
* @return string Singular version of English word
|
* @return string Singular version of English word
|
||||||
* @internal Moved to class to conserve resources.
|
* @internal Moved to class to conserve resources.
|
||||||
*/
|
*/
|
||||||
public static function singular(string $word) : string {
|
public static function singular(string $word) {
|
||||||
//"-es" is used for words that end in "-x", "-s", "-z", "-sh", "-ch" in which case you add
|
//"-es" is used for words that end in "-x", "-s", "-z", "-sh", "-ch" in which case you add
|
||||||
if (substr($word, -2) == "es") {
|
if (substr($word, -2) == "es") {
|
||||||
if (substr($word, -4) == "sses") { // eg. 'addresses' to 'address'
|
if (substr($word, -4) == "sses") { // eg. 'addresses' to 'address'
|
||||||
|
|
@ -2864,7 +2864,7 @@
|
||||||
* @return int Depth of array
|
* @return int Depth of array
|
||||||
* @internal Moved to class to conserve resources.
|
* @internal Moved to class to conserve resources.
|
||||||
*/
|
*/
|
||||||
public static function array_depth(array &$array) : int {
|
public static function array_depth(array &$array) {
|
||||||
$depth = 0;
|
$depth = 0;
|
||||||
if (is_array($array)) {
|
if (is_array($array)) {
|
||||||
$depth++;
|
$depth++;
|
||||||
|
|
@ -2991,7 +2991,7 @@
|
||||||
* @return string Sanitized using preg_replace('#[^a-zA-Z0-9_\-]#', '')
|
* @return string Sanitized using preg_replace('#[^a-zA-Z0-9_\-]#', '')
|
||||||
* @see preg_replace()
|
* @see preg_replace()
|
||||||
*/
|
*/
|
||||||
public static function sanitize(string $value) : string {
|
public static function sanitize(string $value) {
|
||||||
return preg_replace('#[^a-zA-Z0-9_\-]#', '', $value);
|
return preg_replace('#[^a-zA-Z0-9_\-]#', '', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3006,7 +3006,7 @@
|
||||||
* @see database::__construct()
|
* @see database::__construct()
|
||||||
* @see database::connect()
|
* @see database::connect()
|
||||||
*/
|
*/
|
||||||
public static function &new() : database {
|
public static function &new() {
|
||||||
$db = new database();
|
$db = new database();
|
||||||
$db->connect();
|
$db->connect();
|
||||||
return $db;
|
return $db;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue