- improved find-bad-php.sh
- RegistryIterator->rewind() doesn't need to rewind when there is nothing to
iterate
- imported deprecated class
- HEADER=$(cat ${SCRIPT} | head -n 1 | grep -v "<?")
+ SHORT_OPEN_TAG=$(cat ${SCRIPT} | head -n 1 | grep -v "<?")
+ CLOSING_TAG=$(cat ${SCRIPT} | tail -n 1 | grep "?>")
- FOOTER=$(cat ${SCRIPT} | tail -n 1 | grep "?>")
-
- if [ -n "${HEADER}" ];
+ if [ -n "${SHORT_OPEN_TAG}" ];
- echo "$0: Script '${SCRIPT}' has non-typical header."
+ echo "$0: Script '${SCRIPT}' has short opening tag (<?)."
+ if [ -n "${CLOSING_TAG}" ];
- echo "$0: Script '${SCRIPT}' has discouraged footer."
+ echo "$0: Script '${SCRIPT}' has discouraged closing tag (?>)."
fi
LINT=$(php -l "${SCRIPT}" 2>&1 | grep -v "Constant FUSE_EDEADLK already defined in Unknown on line 0" | grep -v "No syntax errors detected in")
fi
LINT=$(php -l "${SCRIPT}" 2>&1 | grep -v "Constant FUSE_EDEADLK already defined in Unknown on line 0" | grep -v "No syntax errors detected in")
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
+// Deprecated imports
+use Org\Mxchange\CoreFramework\Deprecated\PathIsNoDirectoryException;
+
// Import SPL stuff
use \DirectoryIterator;
// Import SPL stuff
use \DirectoryIterator;
/**
* All found registry keys
*/
/**
* All found registry keys
*/
- private $registryKeys = array();
+ private $registryKeys = [];
$entries = $this->getRegistryInstance()->getGenericRegistry();
// Init registry keys array
$entries = $this->getRegistryInstance()->getGenericRegistry();
// Init registry keys array
- $this->registryKeys['generic'] = array();
+ $this->registryKeys['generic'] = [];
// Anything in there?
if (count($entries) > 0) {
// Anything in there?
if (count($entries) > 0) {
$entries = $this->getRegistryInstance()->getInstanceRegistry();
// Init registry keys array
$entries = $this->getRegistryInstance()->getInstanceRegistry();
// Init registry keys array
- $this->registryKeys['instance'] = array();
+ $this->registryKeys['instance'] = [];
// Anything in there?
if (count($entries) > 0) {
// Anything in there?
if (count($entries) > 0) {
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,entry[]=%s - Adding ...', $key, gettype($entry)));
// Add key to array
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,entry[]=%s - Adding ...', $key, gettype($entry)));
// Add key to array
- $this->registryKeys['instance'][$key] = array();
+ $this->registryKeys['instance'][$key] = [];
} // END - foreach
} // END - if
}
} // END - foreach
} // END - if
}
* @return void
*/
public function rewind () {
* @return void
*/
public function rewind () {
+ // Is the registry empty?
+ if (count($this->registryKeys) == 0) {
+ // Then no need to continue
+ return;
+ } // END - if
+
// Debugging:
/* DEBUG-DIE: */ die(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
}
// Debugging:
/* DEBUG-DIE: */ die(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
}