<?php /** * Test that all untranslated encapsed strings are caught. * * At the same time it is used to test that strings are properly ignored. * * @package WP_L10n_Validator\Tests * @since 0.1.0 */ $unstranslated = 'translate me!'; $untranslated = some_function('I should be translated'); echo 'l10n is fun.'; $ignored = ignored_function('ignored string'); include 'some_file.php'; require_once MY_CONSTANT . '/another_file.php'; switch ($var) { case 'bob': case 'joe': do_stuff(); break; } $url = 'http://example.com/'; $not_url = 'http is a web protocol'; $ignore = 'all_lowercase_with_underscores'; $ignore = '_underscore_in_front'; $catch_me = "Don't {$ignore} this!"; $file = 'file/to/ignore.php'; $path = '/includes'; $other_path = 'src/includes/'; $maybe = 'and/or';
class SOME_CLASS { public function some_method() { $x = __LINE__; // echo "$x\n"; $x = __FILE__; echo "{$x}\n"; $x = __FUNCTION__; echo "{$x}\n"; $x = __METHOD__; echo "{$x}\n"; $x = __CLASS__; echo "{$x}\n"; } } $x = __LINE__; // echo "$x\n"; $x = __FILE__; echo "{$x}\n"; $x = __FUNCTION__; echo "{$x}\n"; $x = __METHOD__; echo "{$x}\n"; $x = __CLASS__; echo "{$x}\n"; some_function(); $y = new SOME_CLASS(); $y->some_method(); $z = new A(); $z->some_method();
<?php /** * Github Issue: https://github.com/ejmr/php-mode/issues/102 * * Every line of code in the form of * * $broken = true; * * in the code below should have no indentation. This test makes sure * that files containing magic constants, e.g. __FILE__, do not * incorrectly affect the indentation of following lines. * */ $x = some_function(__FILE__) . ''; $broken = true; some_function(__FILE__) . ''; $broken = true; some_function(__FILE__) + 1; $broken = true;
?> </p> <p>View a page test / example <?php echo '<a href="' . $this->getHost() . '/page-test">(Click here)</a>'; ?> </p> <p>View a folder example <?php echo '<a href="' . $this->getHost() . '/blogs">(Click here)</a>'; ?> </p> <p> <?php $param = $this->getParam('param'); if (empty($param)) { echo '<a href="' . $this->getHost() . '/param_' . urlencode('this is what param equals in the url') . '">View a url parameter</a>'; } else { echo '<b>URL parameter:</b> (param) ' . $param . ' <a href="' . $this->getHost() . '/">Remove</a>'; } ?> </p> <p><b>PHP function call:</b> <?php echo some_function(); ?> </p> <p>Your time starts now.</p> </div> </div> </div> <?php $this->staticInclude('footer.html');