PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: 2 days ago
Size: 1,470 bytes
 

Contents

Class file image Download
<?php

echo 'var is '.(($var < 0) ? 'negative' : 'positive');
echo
'var is '.($var < 0 ? 'negative' : 'positive');
echo
'var is '.(($var < 0) ? 'negative' :'positive');
echo
'var is '.(($var < 0) ? 'negative': 'positive');
echo
'var is '.(($var < 0) ? 'negative' : 'positive');
echo
'var is '.(($var < 0) ? 'negative' : 'positive');
echo
'var is '.(($var < 0) ? 'negative' : 'positive');
echo
'var is '.(($var < 0) ? 'negative' : 'positive');

echo
'var is '.(($var < 0)
                    ?
'negative'
                   
: 'positive');

$args = array(
        
'"'.$this->id.'"',
        
'"'.$this->stepInfo['title'].'"',
        
'"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"',
        
'"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"',
        
'"'.$this->stepInfo['title'].'"',
        );

echo (
TRUE)?'Hello':'Bye';

$array = array(
   
'one' => ($test == 1) ? true : false,
   
'two' => (($test == 1) ? true : false),
   
'three' => (($test == 1) ? true : false)
);
$var = ($test == 1) ? true : false;
$var = (myFunc(1,2,3) == 1) ? true : false;

set('config', function() {
   
$foo = ($bar === "on") ? "1" : "2";
});

$config = function() {
   
$foo = ($bar === "on") ? "1" : "2";
};

rand(0, 1) ? '?????эбн' : NULL;

$c = ($argv[1]) ? : "";
$filepath = realpath($argv[1]) ?: $argv[1];
$c = ($argv[1]) ? /* comment */ : "";
$c = ($argv[1]) ?
:
"";