Changeset 695


Ignore:
Timestamp:
Aug 8, 2019 10:01:13 PM (5 years ago)
Author:
anonymous
Message:

Change usage of is_a($x, 'X') to $x instance of X

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/user.cli.php

    r686 r695  
    6161}
    6262
    63 if (!isset($db) || !is_a($db, 'DB')) {
     63if (!isset($db) || !($db instanceof \DB)) {
    6464    echo "This project doesn't have a \$db object.\n";
    6565    exit(1);
    6666}
    6767
    68 if (!isset($auth) || !is_a($auth, 'Auth_SQL')) {
     68if (!isset($auth) || !($auth instanceof \Auth_SQL)) {
    6969    echo "This project doesn't have an \$auth object.\n";
    7070    exit(1);
  • trunk/services/css.php

    r469 r695  
    2828 * ever modify this file.
    2929 */
    30 if (is_a($css, 'CSS')) {
     30if ($css instanceof \CSS) {
    3131    $css->headers(getFormData('app'));
    3232    $css->output(getFormData('app'));
  • trunk/services/js.php

    r469 r695  
    2828 * ever modify this file.
    2929 */
    30 if (is_a($js, 'JS')) {
     30if ($js instanceof \JS) {
    3131    $js->headers(getFormData('app'));
    3232    $js->output(getFormData('app'));
  • trunk/services/lock.php

    r535 r695  
    4646}
    4747
    48 if (!isset($lock) || !is_a($lock, 'Lock')) {
     48if (!isset($lock) || !($lock instanceof \Lock)) {
    4949    $lock =& Lock::getInstance($auth);
    5050}
  • trunk/services/templates/lock.ihtml

    r592 r695  
    11<?php
    2 if (!is_a($lock, 'Lock')) {
     2if (!($lock instanceof \Lock)) {
    33    // If the Lock object hasn't been instantiated, don't execute this template.
    44    return null;
  • trunk/services/versions.php

    r535 r695  
    107107
    108108case 'restore' :
    109     if (!isset($lock) || !is_a($lock, 'Lock')) {
     109    if (!isset($lock) || !($lock instanceof \Lock)) {
    110110        $lock =& Lock::getInstance($auth);
    111111    }
  • trunk/tests/LockTest.php

    r541 r695  
    102102    {
    103103        $result = Lock::getinstance($this->Auth_SQL);
    104         $this->assertTrue($result && is_a($result, 'Lock'));
     104        $this->assertTrue($result && $result instanceof \Lock);
    105105    }
    106106
  • trunk/tests/VersionTest.php

    r479 r695  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    3737
    3838    function setUp()
    39     {   
     39    {
    4040        require dirname(__FILE__) . '/_config.inc.php';
    4141        require_once '../lib/Version.inc.php';
     
    8484    {
    8585        $db =& DB::getInstance();
    86    
     86
    8787        unset($this->Version);
    8888        unset($this->Auth_SQL);
     
    9595    {
    9696        $result = Version::getinstance($this->Auth_SQL);
    97         $this->assertTrue($result && is_a($result, 'Version'));
     97        $this->assertTrue($result && $result instanceof Version);
    9898    }
    9999
Note: See TracChangeset for help on using the changeset viewer.