mirror of
				https://github.com/Mibew/mibew.git
				synced 2025-11-04 12:25:11 +03:00 
			
		
		
		
	Fix PHP 8.1 compatibility issue with the inherited static variable
This commit is contained in:
		
							parent
							
								
									4f05231b04
								
							
						
					
					
						commit
						ca090638da
					
				@ -42,6 +42,12 @@ abstract class AbstractPlugin
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    protected $weight = 0;
 | 
					    protected $weight = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Path to plugin's files
 | 
				
			||||||
 | 
					     * @var string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private $path = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Default plugin constructor.
 | 
					     * Default plugin constructor.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@ -72,9 +78,8 @@ abstract class AbstractPlugin
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public function getFilesPath()
 | 
					    public function getFilesPath()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        static $path = false;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($path === false) {
 | 
					        if ($this->path === '') {
 | 
				
			||||||
            // Get full name of the file with the current plugin class
 | 
					            // Get full name of the file with the current plugin class
 | 
				
			||||||
            $reflection = new \ReflectionClass($this);
 | 
					            $reflection = new \ReflectionClass($this);
 | 
				
			||||||
            $file_path = $reflection->getFileName();
 | 
					            $file_path = $reflection->getFileName();
 | 
				
			||||||
@ -90,10 +95,10 @@ abstract class AbstractPlugin
 | 
				
			|||||||
                trim($file_path, DIRECTORY_SEPARATOR)
 | 
					                trim($file_path, DIRECTORY_SEPARATOR)
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            array_pop($path_parts);
 | 
					            array_pop($path_parts);
 | 
				
			||||||
            $path = implode(DIRECTORY_SEPARATOR, $path_parts);
 | 
					            $this->path = implode(DIRECTORY_SEPARATOR, $path_parts);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $path;
 | 
					        return $this->path;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user