PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc

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

Contents

Class file image Download
<!-- no problem here --> <?php if (true): ?> <?php foreach ([] as $item): ?> <?php continue; ?> <?php endforeach; ?> <?php endif; ?> <!-- no problem here --> <?php if (true) { ?> <?php foreach ([] as $item) { ?> <?php continue; ?> <?php } ?> <?php } ?> <!-- no problem here --> <?php if (true) { ?> <?php foreach ([] as $item) { ?> <!-- note missing semicolon on next line --> <?php continue ?> <?php } ?> <?php } ?> <!-- should detect an error here --> <?php if (true): ?> <?php foreach ([] as $item): ?> <?php continue; ?> <div>non-executable</div> <?php endforeach; ?> <?php endif; ?> <!-- should detect an error here --> <?php if (true): ?> <?php foreach ([] as $item): ?> <!-- note missing semicolon on next line --> <?php continue ?> <div>non-executable</div> <?php endforeach; ?> <?php endif; ?> <!-- should detect an error here --> <?php if (true): ?> <?php foreach ([] as $item): ?> <?php continue; ?> <div>non-executable</div> <?php endforeach; ?> <?php endif; ?> <!-- should detect an error here --> <?php if (true): ?> <?php foreach ([] as $item): ?> <?php continue; ?> <?= 'unreachable - no semicolon' ?> <?php endforeach; ?> <?php endif; ?> <!-- should detect an error here --> <?php if (true): ?> <?php foreach ([] as $item): ?> <?php continue; ?> <?= 'unreachable - with semicolon'; ?> <?php endforeach; ?> <?php endif; ?>