Heap of bugfixes, cleanup and PHP 7 upgrades

This commit is contained in:
Dylan K. Taylor
2017-07-13 19:18:56 +01:00
parent c2a7c2c6cd
commit 2a7b736f18
49 changed files with 114 additions and 148 deletions

View File

@ -168,7 +168,7 @@ abstract class PluginBase implements Plugin{
* @return bool
*/
protected function isPhar(){
return substr($this->file, 0, 7) === "phar://";
return strpos($this->file, "phar://") === 0;
}
/**

View File

@ -145,7 +145,7 @@ class PluginManager{
* @return Plugin|null
*/
public function loadPlugin($path, $loaders = null){
foreach(($loaders === null ? $this->fileAssociations : $loaders) as $loader){
foreach($loaders ?? $this->fileAssociations as $loader){
if(preg_match($loader->getPluginFilters(), basename($path)) > 0){
$description = $loader->getPluginDescription($path);
if($description instanceof PluginDescription){