further CS fixes

This commit is contained in:
Dylan K. Taylor 2020-03-10 12:18:16 +00:00
parent a72e6ee706
commit 6a507bb149
6 changed files with 12 additions and 4 deletions

View File

@ -23,6 +23,10 @@ declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use function define;
use function defined;
use function dirname;
// composer autoload doesn't use require_once and also pthreads can inherit things // composer autoload doesn't use require_once and also pthreads can inherit things
if(defined('pocketmine\_CORE_CONSTANTS_INCLUDED')){ if(defined('pocketmine\_CORE_CONSTANTS_INCLUDED')){
return; return;

View File

@ -23,6 +23,8 @@ declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use const PTHREADS_INHERIT_ALL;
/** /**
* This class must be extended by all custom threading classes * This class must be extended by all custom threading classes
*/ */
@ -78,7 +80,7 @@ abstract class Thread extends \Thread{
* *
* @return bool * @return bool
*/ */
public function start(?int $options = \PTHREADS_INHERIT_ALL){ public function start(?int $options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this); ThreadManager::getInstance()->add($this);
if($this->getClassLoader() === null){ if($this->getClassLoader() === null){

View File

@ -23,6 +23,8 @@ declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use function defined;
// composer autoload doesn't use require_once and also pthreads can inherit things // composer autoload doesn't use require_once and also pthreads can inherit things
// TODO: drop this file and use a final class with constants // TODO: drop this file and use a final class with constants
if(defined('pocketmine\_VERSION_INFO_INCLUDED')){ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){

View File

@ -23,6 +23,8 @@ declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use const PTHREADS_INHERIT_ALL;
/** /**
* This class must be extended by all custom threading classes * This class must be extended by all custom threading classes
*/ */
@ -78,7 +80,7 @@ abstract class Worker extends \Worker{
* *
* @return bool * @return bool
*/ */
public function start(?int $options = \PTHREADS_INHERIT_ALL){ public function start(?int $options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this); ThreadManager::getInstance()->add($this);
if($this->getClassLoader() === null){ if($this->getClassLoader() === null){

View File

@ -27,7 +27,6 @@ namespace pocketmine\network\mcpe;
use pocketmine\entity\Attribute; use pocketmine\entity\Attribute;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;
use pocketmine\entity\Skin;
use pocketmine\item\Durable; use pocketmine\item\Durable;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\item\ItemFactory; use pocketmine\item\ItemFactory;

View File

@ -25,7 +25,6 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h> #include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkBinaryStream; use pocketmine\network\mcpe\NetworkBinaryStream;
use pocketmine\network\mcpe\NetworkSession; use pocketmine\network\mcpe\NetworkSession;
use function assert; use function assert;