]> git.mxchange.org Git - friendica.git/commitdiff
Changed:
authorRoland Häder <roland@mxchange.org>
Mon, 20 Jun 2022 06:18:53 +0000 (08:18 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 20 Jun 2022 06:20:07 +0000 (08:20 +0200)
- DBA::exists() should only be used for checking if records exists.
- if you want to check if a table exists, please ALWAYS use
  DBStructure::existsTable() instead

src/Database/DBA.php
tests/src/Database/DBATest.php
tests/src/Database/DBStructureTest.php

index d7c0421b7a2a69d283e962a891e4acc64b75a008..e519a63cd6f99e468b753192ac949aca6d577796 100644 (file)
@@ -218,8 +218,8 @@ class DBA
        /**
         * Check if data exists
         *
-        * @param string|array $table     Table name or array [schema => table]
-        * @param array        $condition array of fields for condition
+        * @param string|array $table Table name or array [schema => table]
+        * @param array               $condition array of fields for condition
         * @return boolean Are there rows for that condition?
         * @throws \Exception
         */
index c92133ac54ba2dd068da9a7fd807628be1ebb75d..febe9c8c622847737f2e3b150d026dd335a0729f 100644 (file)
@@ -55,9 +55,6 @@ class DBATest extends DatabaseTest
                self::assertTrue(DBA::exists('config', []));
                self::assertFalse(DBA::exists('notable', []));
 
-               self::assertTrue(DBA::exists('config', null));
-               self::assertFalse(DBA::exists('notable', null));
-
                self::assertTrue(DBA::exists('config', ['k' => 'hostname']));
                self::assertFalse(DBA::exists('config', ['k' => 'nonsense']));
        }
index 638a98ed7a2350db9d08d36bf1377f667481f76c..613e2f7832010948386d5b12b3e8f2230d9cfc14 100644 (file)
@@ -45,7 +45,6 @@ class DBStructureTest extends DatabaseTest
         */
        public function testExists() {
                self::assertTrue(DBStructure::existsTable('config'));
-
                self::assertFalse(DBStructure::existsTable('notatable'));
 
                self::assertTrue(DBStructure::existsColumn('config', ['k']));