Code Duplication    Length = 29-29 lines in 6 locations

src/cli/Database/Base/Connection.php 1 location

@@ 1557-1585 (lines=29) @@
1554
     *
1555
     * @return array|string
1556
     */
1557
    public function __call($name, $params)
1558
    {
1559
        if (0 === strpos($name, 'get')) {
1560
            $virtualColumn = substr($name, 3);
1561
            if ($this->hasVirtualColumn($virtualColumn)) {
1562
                return $this->getVirtualColumn($virtualColumn);
1563
            }
1564
1565
            $virtualColumn = lcfirst($virtualColumn);
1566
            if ($this->hasVirtualColumn($virtualColumn)) {
1567
                return $this->getVirtualColumn($virtualColumn);
1568
            }
1569
        }
1570
1571
        if (0 === strpos($name, 'from')) {
1572
            $format = substr($name, 4);
1573
1574
            return $this->importFrom($format, reset($params));
1575
        }
1576
1577
        if (0 === strpos($name, 'to')) {
1578
            $format = substr($name, 2);
1579
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1580
1581
            return $this->exportTo($format, $includeLazyLoadColumns);
1582
        }
1583
1584
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1585
    }
1586
1587
}
1588

src/cli/Database/Base/Channel.php 1 location

@@ 1653-1681 (lines=29) @@
1650
     *
1651
     * @return array|string
1652
     */
1653
    public function __call($name, $params)
1654
    {
1655
        if (0 === strpos($name, 'get')) {
1656
            $virtualColumn = substr($name, 3);
1657
            if ($this->hasVirtualColumn($virtualColumn)) {
1658
                return $this->getVirtualColumn($virtualColumn);
1659
            }
1660
1661
            $virtualColumn = lcfirst($virtualColumn);
1662
            if ($this->hasVirtualColumn($virtualColumn)) {
1663
                return $this->getVirtualColumn($virtualColumn);
1664
            }
1665
        }
1666
1667
        if (0 === strpos($name, 'from')) {
1668
            $format = substr($name, 4);
1669
1670
            return $this->importFrom($format, reset($params));
1671
        }
1672
1673
        if (0 === strpos($name, 'to')) {
1674
            $format = substr($name, 2);
1675
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1676
1677
            return $this->exportTo($format, $includeLazyLoadColumns);
1678
        }
1679
1680
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1681
    }
1682
1683
}
1684

src/cli/Database/Base/Input.php 1 location

@@ 1903-1931 (lines=29) @@
1900
     *
1901
     * @return array|string
1902
     */
1903
    public function __call($name, $params)
1904
    {
1905
        if (0 === strpos($name, 'get')) {
1906
            $virtualColumn = substr($name, 3);
1907
            if ($this->hasVirtualColumn($virtualColumn)) {
1908
                return $this->getVirtualColumn($virtualColumn);
1909
            }
1910
1911
            $virtualColumn = lcfirst($virtualColumn);
1912
            if ($this->hasVirtualColumn($virtualColumn)) {
1913
                return $this->getVirtualColumn($virtualColumn);
1914
            }
1915
        }
1916
1917
        if (0 === strpos($name, 'from')) {
1918
            $format = substr($name, 4);
1919
1920
            return $this->importFrom($format, reset($params));
1921
        }
1922
1923
        if (0 === strpos($name, 'to')) {
1924
            $format = substr($name, 2);
1925
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1926
1927
            return $this->exportTo($format, $includeLazyLoadColumns);
1928
        }
1929
1930
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1931
    }
1932
1933
}
1934

src/cli/Database/Base/Instance.php 1 location

@@ 2604-2632 (lines=29) @@
2601
     *
2602
     * @return array|string
2603
     */
2604
    public function __call($name, $params)
2605
    {
2606
        if (0 === strpos($name, 'get')) {
2607
            $virtualColumn = substr($name, 3);
2608
            if ($this->hasVirtualColumn($virtualColumn)) {
2609
                return $this->getVirtualColumn($virtualColumn);
2610
            }
2611
2612
            $virtualColumn = lcfirst($virtualColumn);
2613
            if ($this->hasVirtualColumn($virtualColumn)) {
2614
                return $this->getVirtualColumn($virtualColumn);
2615
            }
2616
        }
2617
2618
        if (0 === strpos($name, 'from')) {
2619
            $format = substr($name, 4);
2620
2621
            return $this->importFrom($format, reset($params));
2622
        }
2623
2624
        if (0 === strpos($name, 'to')) {
2625
            $format = substr($name, 2);
2626
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
2627
2628
            return $this->exportTo($format, $includeLazyLoadColumns);
2629
        }
2630
2631
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
2632
    }
2633
2634
}
2635

src/cli/Database/Base/Subscription.php 1 location

@@ 1999-2027 (lines=29) @@
1996
     *
1997
     * @return array|string
1998
     */
1999
    public function __call($name, $params)
2000
    {
2001
        if (0 === strpos($name, 'get')) {
2002
            $virtualColumn = substr($name, 3);
2003
            if ($this->hasVirtualColumn($virtualColumn)) {
2004
                return $this->getVirtualColumn($virtualColumn);
2005
            }
2006
2007
            $virtualColumn = lcfirst($virtualColumn);
2008
            if ($this->hasVirtualColumn($virtualColumn)) {
2009
                return $this->getVirtualColumn($virtualColumn);
2010
            }
2011
        }
2012
2013
        if (0 === strpos($name, 'from')) {
2014
            $format = substr($name, 4);
2015
2016
            return $this->importFrom($format, reset($params));
2017
        }
2018
2019
        if (0 === strpos($name, 'to')) {
2020
            $format = substr($name, 2);
2021
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
2022
2023
            return $this->exportTo($format, $includeLazyLoadColumns);
2024
        }
2025
2026
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
2027
    }
2028
2029
}
2030

src/cli/Database/Base/User.php 1 location

@@ 1969-1997 (lines=29) @@
1966
     *
1967
     * @return array|string
1968
     */
1969
    public function __call($name, $params)
1970
    {
1971
        if (0 === strpos($name, 'get')) {
1972
            $virtualColumn = substr($name, 3);
1973
            if ($this->hasVirtualColumn($virtualColumn)) {
1974
                return $this->getVirtualColumn($virtualColumn);
1975
            }
1976
1977
            $virtualColumn = lcfirst($virtualColumn);
1978
            if ($this->hasVirtualColumn($virtualColumn)) {
1979
                return $this->getVirtualColumn($virtualColumn);
1980
            }
1981
        }
1982
1983
        if (0 === strpos($name, 'from')) {
1984
            $format = substr($name, 4);
1985
1986
            return $this->importFrom($format, reset($params));
1987
        }
1988
1989
        if (0 === strpos($name, 'to')) {
1990
            $format = substr($name, 2);
1991
            $includeLazyLoadColumns = isset($params[0]) ? $params[0] : true;
1992
1993
            return $this->exportTo($format, $includeLazyLoadColumns);
1994
        }
1995
1996
        throw new BadMethodCallException(sprintf('Call to undefined method: %s.', $name));
1997
    }
1998
1999
}
2000