$this->setfields["$field"] = $field;
- if ($dovalidate AND method_exists($this, "validate_$field"))
+ if ($dovalidate && method_exists($this, "validate_$field"))
{
$this->{"validate_$field"}($field);
}
*/
public function setCondition($condition = null)
{
- if (is_array($condition) AND sizeof($condition) > 0)
+ if (is_array($condition) && sizeof($condition) > 0)
{
$this->condition = '';
- foreach ($condition AS $field)
+ foreach ($condition as $field)
{
if (!$this->values["$field"])
{
}
else
{
- foreach ($this->fields AS $name => $options)
+ foreach ($this->fields as $name => $options)
{
if ($options[F_REQ] == REQ_AUTO)
{
$this->_runActionMethod('pre_insert', $doPre);
$fields = $values = array();
- foreach ($this->setfields AS $field)
+ foreach ($this->setfields as $field)
{
$fields[] = $field;
$values[] = $this->_prepareFieldForSql($field);
if (BSApp::$db instanceof BSDbPostgreSql)
{
- foreach ($this->fields AS $field => $info)
+ foreach ($this->fields as $field => $info)
{
if ($info[F_REQ] == REQ_AUTO)
{
$this->_runActionMethod('pre_update', $doPre);
- foreach ($this->setfields AS $field)
+ foreach ($this->setfields as $field)
{
$updates[] = "$field = " . $this->_prepareFieldForSql($field);
}
*/
private function _verifyRequired()
{
- foreach ($this->fields AS $name => $options)
+ foreach ($this->fields as $name => $options)
{
if ($options[F_REQ] == REQ_YES)
{
*/
private function _runActionMethod($method, $doRun)
{
- if (!$doRun OR !method_exists($this, $method))
+ if (!$doRun || !method_exists($this, $method))
{
return;
}
{
$type = $this->fields["$name"][F_TYPE];
- if ($type == TYPE_NONE OR $type == TYPE_STR OR $type == TYPE_STRUN)
+ if ($type == TYPE_NONE || $type == TYPE_STR || $type == TYPE_STRUN)
{
return "'" . BSApp::$db->escapeString($this->values["$name"]) . "'";
}
if ((bool)ini_get('register_globals') === true)
{
$superglobals = array('_GET', '_COOKIE', '_FILES', '_POST', '_SERVER', '_ENV');
- foreach ($superglobals AS $global)
+ foreach ($superglobals as $global)
{
if (is_array(${$global}))
{
- foreach (${$global} AS $_key => $_val)
+ foreach (${$global} as $_key => $_val)
{
if (isset(${$_key}))
{
public static function get_debug_list()
{
$output = '<select><option>Debug Notices (' . sizeof(self::$debugInfo) . ')</option>';
- foreach (self::$debugInfo AS $notice)
+ foreach (self::$debugInfo as $notice)
{
$output .= "<option>--- $notice</option>";
}
*/
public static function download_file($file, $name, $exit = true)
{
- if (self::is_browser('ie') OR self::is_browser('opera') OR self::is_browser('safari'))
+ if (self::is_browser('ie') || self::is_browser('opera') || self::is_browser('safari'))
{
$mime = 'application/octetstream';
}
// -------------------------------------------------------------------
# Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.1; .NET CLR 1.0.2914)
# Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
- if (preg_match('#msie ([0-9\.]+)#', $useragent, $matches) !== false AND !isset($browser['opera']))
+ if (preg_match('#msie ([0-9\.]+)#', $useragent, $matches) !== false && !isset($browser['opera']))
{
if (isset($matches[1]))
{
// -------------------------------------------------------------------
# Mozilla/5.001 (windows; U; NT4.0; en-us) Gecko/25250101
# Mozilla/5.001 (Macintosh; N; PPC; ja) Gecko/25250101 MegaCorpBrowser/1.0 (MegaCorp, Inc.)
- if (preg_match('#gecko/([0-9]+)#', $useragent, $matches) !== false AND !isset($browser['safari']))
+ if (preg_match('#gecko/([0-9]+)#', $useragent, $matches) !== false && !isset($browser['safari']))
{
if (isset($matches[1]))
{
$path = self::fetch_source_path($path);
$dir = new DirectoryIterator($path);
- foreach ($dir AS $file)
+ foreach ($dir as $file)
{
$name = $file->getFilename();
- if (($file->isDot() OR $name[0] == '.') AND $ignoreDot)
+ if (($file->isDot() || $name[0] == '.') && $ignoreDot)
{
continue;
}
- if ($file->isDir() AND $recurse)
+ if ($file->isDir() && $recurse)
{
$filelist = array_merge($filelist, self::_help_scan_directory($path . $name, $recurse, $ignoreDot, $pathAdd . BSFunctions::fetch_source_path(str_replace($path, '', $file->getPathname()))));
continue;
*/
public static function array_strip_empty($array)
{
- foreach ($array AS $key => $value)
+ foreach ($array as $key => $value)
{
if (is_array($array["$key"]))
{
$array["$key"] = self::array_strip_empty($array["$key"]);
}
- else if (empty($value) OR is_null($value))
+ else if (empty($value) || is_null($value))
{
unset($array["$key"]);
}
// Iterate backtrace
$calls = array();
- foreach ($backtrace AS $i => $call)
+ foreach ($backtrace as $i => $call)
{
if (!isset($call['file']))
{
if (isset($call['args']))
{
$args = array();
- foreach ($call['args'] AS $arg)
+ foreach ($call['args'] as $arg)
{
if (is_array($arg))
{
*/
private function _sanitizeDataRecursive($data)
{
- foreach ($data AS $key => $value)
+ foreach ($data as $key => $value)
{
if (is_array($value))
{
public function escape($str, $force = true)
{
$db = BSApp::$db;
- if ($this->magicquotes AND !$force)
+ if ($this->magicquotes && !$force)
{
if ($db)
{
*/
public function inputCleanArray($vars)
{
- foreach ($vars AS $varname => $type)
+ foreach ($vars as $varname => $type)
{
$this->inputClean($varname, $type);
}
*/
private function _cleanArray($array, $type)
{
- foreach ($array AS $key => $value)
+ foreach ($array as $key => $value)
{
$array["$key"] = $this->clean($value, $type);
}
{
$host = ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST'];
- if ($host AND $_SERVER['HTTP_REFERER'])
+ if ($host && $_SERVER['HTTP_REFERER'])
{
$parts = parse_url($_SERVER['HTTP_REFERER']);
$ourhost = $parts['host'] . (isset($parts['port']) ? ":$parts[port]" : '');
}
$methods = get_class_methods($this);
- foreach ($methods AS $name)
+ foreach ($methods as $name)
{
if (preg_match('/step([0-9]+)/', $name))
{
// attach additional headers
$headers = BSFunctions::convert_line_breaks($this->headers, $this->delim);
- $headers .= ((!preg_match("#{$this->delim}$#", $headers) AND $headers != '') ? "\n" : '') . "From: \"{$fromName}\" <{$from}>" . $this->delim;
+ $headers .= ((!preg_match("#{$this->delim}$#", $headers) && $headers != '') ? "\n" : '') . "From: \"{$fromName}\" <{$from}>" . $this->delim;
$headers .= "Return-Path: {$from}" . $this->delim;
$headers .= "X-Mailer: ISSO Mail Framework" . $this->delim;
$headers .= "MIME-Version: 1.0" . $this->delim;
// see if we need to use mime/multipart
- if ($sendhtml AND !empty($bodyhtml) == true)
+ if ($sendhtml && !empty($bodyhtml) == true)
{
$boundary = 'ISSO-MULTIPART-' . BSFunctions::Rand(10);
$headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\"" . $this->delim;
{
$baselink .= '?';
}
- else if (!preg_match('#\?$#', $baselink) AND !preg_match('#(&|&)$#', $baselink))
+ else if (!preg_match('#\?$#', $baselink) && !preg_match('#(&|&)$#', $baselink))
{
$baselink .= '&';
}
case 'button':
case 'submit':
case 'reset':
- return '<input type="' . $this->type . '"' . $attrs . (($this->type == 'text' OR $this->type == 'password') ? ' size="35" maxlength="255"' : ''). $this->_prepareStyle() . ' />';
+ return '<input type="' . $this->type . '"' . $attrs . (($this->type == 'text' || $this->type == 'password') ? ' size="35" maxlength="255"' : ''). $this->_prepareStyle() . ' />';
break;
case 'hidden':
break;
case 'textarea':
- if (!isset($this->style['height']) OR !isset($this->style['width']))
+ if (!isset($this->style['height']) || !isset($this->style['width']))
{
throw new Exception('BSPrinterBaseElement of type "textarea" require a "height" and "width" style attribute');
}
*/
protected function _prepareStyle()
{
- if (empty($this->style) AND empty($this->cssClass))
+ if (empty($this->style) && empty($this->cssClass))
{
return;
}
$attrs = array();
- foreach ($this->style AS $prop => $value)
+ foreach ($this->style as $prop => $value)
{
$attrs[] = $prop . ': ' . $value;
}
{
$builder = '';
- foreach ($this->children AS $child)
+ foreach ($this->children as $child)
{
$builder .= "\n" . $child->paint();
}
{
$vars = new BSPrinterRootElementForm($controller, $action, 'postvars');
- foreach ($postvars AS $key => $value)
+ foreach ($postvars as $key => $value)
{
$vars->addChild(new BSPrinterBaseElement('hidden', $key, $value));
}
$page = new BSPrinterRootElementPage(_('Confirm'));
$form = new BSPrinterRootElementForm($controller, $action);
- foreach ($params AS $key => $value)
+ foreach ($params as $key => $value)
{
$form->addChild(new BSPrinterBaseElement('hidden', $key, $value));
}
{
$builder = '';
- foreach ($this->children AS $child)
+ foreach ($this->children as $child)
{
$builder .= "\n" . $child->paint() . "\n";
}
echo "\n\t<link rel=\"stylesheet\" href=\"" . BSPrinter::get_stylesheet() . "\" />";
echo "\n</head>\n<body>\n";
- if ($this->navigator AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
+ if ($this->navigator && (!defined('ISSO_PRINTER_NO_NAVIGATION') || !constant('ISSO_PRINTER_NO_NAVIGATION')))
{
echo $this->navigator->constructHeaderHtml();
}
echo $this->_paintChildren();
- if ($this->navigator AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
+ if ($this->navigator && (!defined('ISSO_PRINTER_NO_NAVIGATION') || !constant('ISSO_PRINTER_NO_NAVIGATION')))
{
echo $this->navigator->constructFooterHtml();
}
if (BSApp::get_debug())
{
- if (defined('SVN') AND preg_match('#^\$Id:?#', constant('SVN')))
+ if (defined('SVN') && preg_match('#^\$Id:?#', constant('SVN')))
{
echo preg_replace('#\$' . 'Id: (.+?) ([0-9].+?) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.+?) (.+?) \$#', "\n<br />\n" . '<div align="center"><strong>\1</strong> — r\2</div>', constant('SVN'));
}
$head->setCssClass('thead');
$table->addHeadingChild($head);
- foreach ($queries AS $query)
+ foreach ($queries as $query)
{
$tr = new BSPrinterTableElement();
$tr->addChild(new BSPrinterLabelElement("\n\t\t\t" . $query['query'] . "\n\n\t\t\t<div class=\"smallfont\">(" . $query['time'] . ")</div>\n<!--\n" . $query['trace'] . "\n-->\n\t\t"));
*/
private function _calculateColumnCount()
{
- foreach ($this->children AS $child)
+ foreach ($this->children as $child)
{
if ($child->numberOfColumns() > $this->colspan)
{
$this->_calculateColumnCount();
- foreach ($this->children AS $child)
+ foreach ($this->children as $child)
{
$child->setColumnNumber($this->colspan);
$builder .= "\n" . $child->paint();
$build = '';
if (sizeof($children) > 0)
{
- foreach ($children AS $child)
+ foreach ($children as $child)
{
$build .= "\n\t\t\t" . $child->paint();
}
public static function row_list($label, $name, Array $options)
{
$build = '';
- foreach ($options AS $option)
+ foreach ($options as $option)
{
if ($option->getType() == 'option')
{
public static function row_checkbox($label, $name, Array $boxes)
{
$build = '';
- foreach ($boxes AS $boxLabel => $box)
+ foreach ($boxes as $boxLabel => $box)
{
if ($box->getType() == 'checkbox')
{
}
$i = 0;
- foreach ($this->children AS $child)
+ foreach ($this->children as $child)
{
$i++;
- $colspan = (($i == $numCols AND !$even) ? $cols + 1 : $cols);
+ $colspan = (($i == $numCols && !$even) ? $cols + 1 : $cols);
$builder .= "\n\t\t<td" . ($colspan > 1 ? ' colspan="' . $colspan . '"' : '') . ">" . $child->paint() . "</td>";
}
$dbCache["$tpl[filename]"] = $template;
}
}
- foreach ($namearray AS $name)
+ foreach ($namearray as $name)
{
if ($this->dbCacheTable)
{
if (sizeof($this->uncached) > 0)
{
- foreach ($this->uncached AS $name => $count)
+ foreach ($this->uncached as $name => $count)
{
$tpls[] = $name . "($count)";
}
$debugBlock .= "<br />\n" . '<table cellpadding="4" cellspacing="1" border="0" align="center" width="30%" style="background-color: rgb(60, 60, 60); color: white">' . "\n\t" . '<tr><td><strong>Query Debug</strong></td></tr>';
- foreach ($queries AS $query)
+ foreach ($queries as $query)
{
$debugBlock .= "\n\t<tr style=\"background-color: rgb(230, 230, 230); color: black\">";
$debugBlock .= "\n\t\t<td>";
protected function _loadTemplate($name)
{
$path = $this->templateDir . $name . '.' . $this->extension;
- if (is_file($path) AND is_readable($path))
+ if (is_file($path) && is_readable($path))
{
return @file_get_contents($path);
}
for ($i = 0; $i < strlen($template); $i++)
{
// we've run through the template and there's nothing in the stack--done
- if ($i == strlen($template) - 1 AND sizeof($stack) == 0)
+ if ($i == strlen($template) - 1 && sizeof($stack) == 0)
{
return $template;
}
$token = substr($token, 1, strlen($token) - 2);
// language token
- if ($token[0] == '@' AND $token[1] == '\\' AND $token[2] == '"')
+ if ($token[0] == '@' && $token[1] == '\\' && $token[2] == '"')
{
return '" . ' . $this->langcall . '(\'' . str_replace(array('\\\"', "'"), array('"', "\'"), substr($token, 3, strlen($token) - 5)) . '\')' . ' . "';
}
throw new Exception('Invalid language variable index "' . $capture . '"');
}
}
- else if ($template[$i] == '>' AND $template[$i - 1] == '"')
+ else if ($template[$i] == '>' && $template[$i - 1] == '"')
{
// the final variable substitution
$varMap[intval($varNum)] = BSFunctions::substring($template, $capturePos + 3, $i - 2);
// locate else tags
else if (substr($template, $i, strlen($tag_else)) == $tag_else)
{
- if (sizeof($stack) == 0 AND !isset($tag_full['else']))
+ if (sizeof($stack) == 0 && !isset($tag_full['else']))
{
$tag_full['else'] = $i;
}
catch (ApiException $e)
{
$i = 0;
- foreach ($e->getExceptions() AS $exc)
+ foreach ($e->getExceptions() as $exc)
{
if ($exc instanceof FieldException)
{
);
// simulate magic quotes GPC
- /*foreach (array($_GET, $_COOKIE) AS $array)
+ /*foreach (array($_GET, $_COOKIE) as $array)
{
- foreach ($array AS $var => $value)
+ foreach ($array as $var => $value)
{
$array["$var"] = addslashes($value);
}
$filelist = BSFunctions::ScanDirectory('.');
-foreach ($filelist AS $file)
+foreach ($filelist as $file)
{
$ext = BSFunctions::FetchExtension($file);
if ($ext == 'php')
{
$files[dirname($file)] = BSFunctions::FetchSourcePath(dirname($file)) . '*.php';
}
- else if ($ext == 'xml' OR $ext == 'tpl' OR $ext == 'html' OR $ext == 'htm')
+ else if ($ext == 'xml' || $ext == 'tpl' || $ext == 'html' || $ext == 'htm')
{
$files[dirname($file)] = BSFunctions::FetchSourcePath(dirname($file)) . '*.php';
$templates[] = array(
return '<?php gettext("' . $text . '"); ?>';
}
-foreach ($templates AS $paths)
+foreach ($templates as $paths)
{
$template = file_get_contents($paths['orig']);
// ###################################################################
// remove all the files we no longer need
-foreach ($removelater AS $path)
+foreach ($removelater as $path)
{
unlink($path);
}
{
array_walk($index, 'trim');
- if ($index['Sub_part'] AND $input->in['engine'] == 'postgresql')
+ if ($index['Sub_part'] && $input->in['engine'] == 'postgresql')
{
$subpart = " ($index[Sub_part])";
}
{
$keys['fulltext']["$index[Key_name]"][] = "$t$index[Column_name]$t$subpart";
}
- else if ($index['Index_type'] == 'BTREE' AND $index['Non_unique'] == 0)
+ else if ($index['Index_type'] == 'BTREE' && $index['Non_unique'] == 0)
{
$keys['unique']["$index[Key_name]"][] = "$t$index[Column_name]$t$subpart";
}
- else if ($index['Index_type'] == 'BTREE' AND $index['Non_unique'] == 1)
+ else if ($index['Index_type'] == 'BTREE' && $index['Non_unique'] == 1)
{
$keys['std']["$index[Key_name]"][] = "$t$index[Column_name]$t$subpart";
}
$field['Type'] = 'int';
}
- if ($input->in['engine'] == 'mysql' AND $field['Type'] != 'bool')
+ if ($input->in['engine'] == 'mysql' && $field['Type'] != 'bool')
{
$field['Type'] .= $matches[3];
}
}
if ($keys['fulltext'])
{
- foreach ($keys['fulltext'] AS $name => $columns)
+ foreach ($keys['fulltext'] as $name => $columns)
{
$build .= ",\n\tFULLTEXT KEY $t$name$t (" . implode(', ', $columns) . ")";
}
}
if ($keys['unique'])
{
- foreach ($keys['unique'] AS $name => $columns)
+ foreach ($keys['unique'] as $name => $columns)
{
$build .= ",\n\tUNIQUE KEY $t$name$t (" . implode(', ', $columns) . ")";
}
}
if ($keys['std'])
{
- foreach ($keys['std'] AS $name => $columns)
+ foreach ($keys['std'] as $name => $columns)
{
$build .= ",\n\tKEY $t$name$t (" . implode(', ', $columns) . ")";
}
if ($input->in['variable'] != '')
{
- foreach ($queries AS $table => $query)
+ foreach ($queries as $table => $query)
{
$output[] = "\${$input->in['variable']}['$table'] = \"\n$query\";";
}
$path = '/Server/htdocs/sportal/';
$filelist = fetch_flat_listing($path);
-foreach ($filelist AS $filename)
+foreach ($filelist as $filename)
{
$fpath = $path . $filename;
$file = file_get_contents($fpath);
$perfile["$fpath"] = $templist['methods'];
}
-foreach ($elements['methods']['functions'] AS $name)
+foreach ($elements['methods']['functions'] as $name)
{
$count['functions']["$name"] = 0;
}
-foreach ($elements['methods']['classes'] AS $name => $methods)
+foreach ($elements['methods']['classes'] as $name => $methods)
{
- foreach ($methods AS $method)
+ foreach ($methods as $method)
{
$count['classes']["$name"]["$method"] = 0;
}
}
-foreach ($filelist AS $filename)
+foreach ($filelist as $filename)
{
$fpath = $path . $filename;
{
while (($file = readdir($handle)) !== false)
{
- if (substr($file, 0, 1) != '.' AND $file != 'CVS')
+ if (substr($file, 0, 1) != '.' && $file != 'CVS')
{
if (is_dir($path . $file))
{
{
$filelist = fetch_listing($path);
- foreach ($filelist AS $basepath => $files)
+ foreach ($filelist as $basepath => $files)
{
- foreach ($files AS $file)
+ foreach ($files as $file)
{
- if (substr($file, (strlen($file) - 1), 1) != '/' AND preg_match('#\.php$#', $file) AND !strpos($basepath, '3rdparty') AND !strpos($basepath, 'phpdoc') AND !strpos($basepath, 'jpgraph'))
+ if (substr($file, (strlen($file) - 1), 1) != '/' && preg_match('#\.php$#', $file) && !strpos($basepath, '3rdparty') && !strpos($basepath, 'phpdoc') && !strpos($basepath, 'jpgraph'))
{
$flatlist[] = "./$basepath$file";
}
// remove invalid tokens
$i = 0;
- foreach ($tokens AS $id => $bit)
+ foreach ($tokens as $id => $bit)
{
unset($tokens["$id"]);
if (is_array($bit))
{
$gt["$i"][0] = '-1';
$gt["$i"][1] = $bit;
- if ($bit == '(' OR $bit == ')')
+ if ($bit == '(' || $bit == ')')
{
$gt["$i"][2] = 'P_' . ($bit == '(' ? 'OPEN' : 'CLOSE');
}
// get what we're looking for
$triggers = array('new' => array(), 'popen' => array());
- foreach ($methodlist['classes'] AS $name => $methods)
+ foreach ($methodlist['classes'] as $name => $methods)
{
$triggers['new'][] = $name;
$triggers['popen'] = array_merge($triggers['popen'], $methods);
$triggers['popen'] = array_merge($triggers['popen'], $methodlist['functions']);
// find a list of all the defined objects
- foreach ($gt AS $id => $bit)
+ foreach ($gt as $id => $bit)
{
$prevbit = $gt[ $id - 1 ];
$nextbit = $gt[ $id + 1 ];
if ($bit[2] == 'T_NEW')
{
- if ($prevbit[2] == 'T_VARIABLE' AND $nextbit[2] == 'T_STRING' AND in_array($nextbit[1], $triggers['new']))
+ if ($prevbit[2] == 'T_VARIABLE' && $nextbit[2] == 'T_STRING' && in_array($nextbit[1], $triggers['new']))
{
$objects["$prevbit[1]"] = $nextbit[1];
}
}
if ($bit[2] == 'T_EXTENDS')
{
- if ($prevbit[2] == 'T_STRING' AND $nextbit[2] == 'T_STRING' AND in_array($prevbit[1], $triggers['new']) AND in_array($prevbit[1], $triggers['new']))
+ if ($prevbit[2] == 'T_STRING' && $nextbit[2] == 'T_STRING' && in_array($prevbit[1], $triggers['new']) && in_array($prevbit[1], $triggers['new']))
{
$extends["$prevbit[1]"] = $nextbit[1];
}
$root = 0;
$stack = array();
$functlist = array();
- foreach ($gt AS $id => $bit)
+ foreach ($gt as $id => $bit)
{
$token = $bit[2];
$prevbit = $gt[ $id - 1 ];
$nextbit = $gt[ $id + 1 ];
// handle object calls
- if ($token == 'T_DOUBLE_COLON' OR $token == 'T_PAAMAYIM_NEKUDOTAYIM' OR $token == 'T_OBJECT_OPERATOR')
+ if ($token == 'T_DOUBLE_COLON' || $token == 'T_PAAMAYIM_NEKUDOTAYIM' || $token == 'T_OBJECT_OPERATOR')
{
$classname = null;
else if ($prevbit[1] == 'parent')
{
// find a class that the call could be in
- foreach ($limiters AS $class => $limits)
+ foreach ($limiters as $class => $limits)
{
- if ($bit[3] > $limits[0] AND $bit[3] < $limits[1])
+ if ($bit[3] > $limits[0] && $bit[3] < $limits[1])
{
$refclass = $class;
}
else if ($prevbit[1] == '$this')
{
// find a class that the call could be in
- foreach ($limiters AS $class => $limits)
+ foreach ($limiters as $class => $limits)
{
- if ($bit[3] > $limits[0] AND $bit[3] < $limits[1])
+ if ($bit[3] > $limits[0] && $bit[3] < $limits[1])
{
$refclass = $class;
}
}
}
// initial
- else if ($token == 'T_STRING' AND $nextbit[2] == 'P_OPEN' AND $prevbit[2] != 'T_FUNCTION' AND $prevbit[2] != 'T_DOUBLE_COLON' AND $prevbit[2] != 'T_PAAMAYIM_NEKUDOTAYIM' AND $prevbit[2] != 'T_OBJECT_OPERATOR' AND !in_array($bit[1], $triggers['new']))
+ else if ($token == 'T_STRING' && $nextbit[2] == 'P_OPEN' && $prevbit[2] != 'T_FUNCTION' && $prevbit[2] != 'T_DOUBLE_COLON' && $prevbit[2] != 'T_PAAMAYIM_NEKUDOTAYIM' && $prevbit[2] != 'T_OBJECT_OPERATOR' && !in_array($bit[1], $triggers['new']))
{
$incall = true;
$root = $id;
$functlist["$id"] = $bit[1];
}
// parens in call
- else if ($token == 'P_OPEN' AND $incall)
+ else if ($token == 'P_OPEN' && $incall)
{
array_push($stack, $id);
}
// close parens in call
- else if ($token == 'P_CLOSE' AND $incall)
+ else if ($token == 'P_CLOSE' && $incall)
{
// find the most recent function
$end = array_pop($stack) - 1;
}
// we're done with all functions and the semi colon is next
- if (count($stack) == 0 AND $nextbit[2] == 'SC')
+ if (count($stack) == 0 && $nextbit[2] == 'SC')
{
$incall = false;
}
// remove invalid tokens
$i = 0;
- foreach ($tokens AS $id => $bit)
+ foreach ($tokens as $id => $bit)
{
unset($tokens["$id"]);
if (is_array($bit))
$infunction = false;
$class = '';
$stack = array();
- foreach ($gt AS $id => $bit)
+ foreach ($gt as $id => $bit)
{
$token = $bit[2];
$nextbit = $gt[ $id + 1 ];
array_pop($stack);
// breaking out of a method
- if ($inclass AND $infunction)
+ if ($inclass && $infunction)
{
if (count($stack) < 2)
{
}
}
// breaking out of a class
- else if ($inclass AND !$infunction)
+ else if ($inclass && !$infunction)
{
if (count($stack) < 1)
{
}
}
// breaking out of a function
- else if (!$inclass AND $infunction)
+ else if (!$inclass && $infunction)
{
if (count($stack) == 0)
{
$punctstrip = str_replace(array('"', '"', '\'', '&', '/', '.', ',', '!', '@', ';', ':', '[', ']', '(', ')'), '', $wordrunner_text);
$wordarray = preg_split('#[\s]+#', $punctstrip);
- foreach ($wordarray AS $word)
+ foreach ($wordarray as $word)
{
- if (!is_int($word) AND trim($word))
+ if (!is_int($word) && trim($word))
{
$outputlist[ ucwords(strtolower($word)) ]++;
}
arsort($outputlist);
- foreach ($outputlist AS $word => $count)
+ foreach ($outputlist as $word => $count)
{
- if (($_POST['ignoresmalls'] AND $count > 3) OR !$_POST['ignoresmalls'])
+ if (($_POST['ignoresmalls'] && $count > 3) || !$_POST['ignoresmalls'])
{
echo "<tr>\r\t<td>$word</td>\r\t<td>$count</td>\r</tr>\r";
}