Skip to content

Commit

Permalink
attempt to fix psr4
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilal Zeidan committed Jun 10, 2023
1 parent cb5c83a commit b05d597
Show file tree
Hide file tree
Showing 18 changed files with 102 additions and 112 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"autoload": {
"psr-4": {
"Bmz\\Zkteco\\Lib\\": "src/"
"Bmz\\Zkteco\\": "src/"
}
},
"minimum-stability": "dev",
Expand Down
10 changes: 5 additions & 5 deletions src/Lib/Helper/Attendance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Attendance
{
/**
* @param ZKTeco $self
* @param Zkteco $self
* @return array [uid, id, state, timestamp]
*/
static public function get(ZKTeco $self)
static public function get(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down Expand Up @@ -56,10 +56,10 @@ static public function get(ZKTeco $self)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function clear(ZKTeco $self)
static public function clear(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down
6 changes: 3 additions & 3 deletions src/Lib/Helper/Connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\Helper\Util;
use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;
use ErrorException;
use Exception;

Expand All @@ -13,7 +13,7 @@ class Connect
* @param ZKTeco $self
* @return bool
*/
static public function connect(ZKTeco $self)
static public function connect(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down Expand Up @@ -53,7 +53,7 @@ static public function connect(ZKTeco $self)
* @param ZKTeco $self
* @return bool
*/
static public function disconnect(ZKTeco $self)
static public function disconnect(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down
40 changes: 20 additions & 20 deletions src/Lib/Helper/Device.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Device
{
/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function name(ZKTeco $self)
static public function name(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -21,7 +21,7 @@ static public function name(ZKTeco $self)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function enable(ZKTeco $self)
Expand All @@ -35,10 +35,10 @@ static public function enable(ZKTeco $self)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function disable(ZKTeco $self)
static public function disable(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -49,10 +49,10 @@ static public function disable(ZKTeco $self)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed *** this will turn off the device
*/
public static function powerOff(ZKTeco $self)
public static function powerOff(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -63,10 +63,10 @@ public static function powerOff(ZKTeco $self)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed *** this will restart the device
*/
public static function restart(ZKTeco $self)
public static function restart(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -77,10 +77,10 @@ public static function restart(ZKTeco $self)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed *** this will sleep the device
*/
public static function sleep(ZKTeco $self)
public static function sleep(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -91,10 +91,10 @@ public static function sleep(ZKTeco $self)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed *** this will resume the device from sleep
*/
public static function resume(ZKTeco $self)
public static function resume(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -105,10 +105,10 @@ public static function resume(ZKTeco $self)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed *** this will play voice "Thank you"
*/
public static function testVoice(ZKTeco $self)
public static function testVoice(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -119,10 +119,10 @@ public static function testVoice(ZKTeco $self)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed *** this will clear the LCD screen
*/
public static function clearLCD(ZKTeco $self)
public static function clearLCD(Zkteco $self)
{
$self->_section = __METHOD__;

Expand All @@ -132,12 +132,12 @@ public static function clearLCD(ZKTeco $self)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @param $rank *** Line number of text
* @param $text *** Text which will display in the LCD screen
* @return bool|mixed *** this will write text into the LCD
*/
public static function writeLCD(ZKTeco $self, $rank, $text)
public static function writeLCD(Zkteco $self, $rank, $text)
{
$self->_section = __METHOD__;

Expand Down
4 changes: 2 additions & 2 deletions src/Lib/Helper/Door.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Door
{
static public function unlock(ZKTeco $self, $delay)
static public function unlock(Zkteco $self, $delay)
{
$self->_section = __METHOD__;

Expand Down
6 changes: 3 additions & 3 deletions src/Lib/Helper/Face.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Face
{
/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function on(ZKTeco $self)
static public function on(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down
32 changes: 16 additions & 16 deletions src/Lib/Helper/Fingerprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Fingerprint
{
/**
* TODO: Can get data, but don't know how to parse the data. Need more documentation about it...
*
* @param ZKTeco $self
* @param Zkteco $self
* @param integer $uid Unique Employee ID in ZK device
* @return array Binary fingerprint data array (where key is finger ID (0-9))
*/
static public function get(ZKTeco $self, $uid)
static public function get(Zkteco $self, $uid)
{
$self->_section = __METHOD__;

Expand All @@ -32,12 +32,12 @@ static public function get(ZKTeco $self, $uid)


/**
* @param ZKTeco $self
* @param Zkteco $self
* @param integer $uid Unique Employee ID in ZK device
* @param integer $finger Finger ID (0-9)
* @return array
*/
private function _getFinger(ZKTeco $self, $uid, $finger)
private function _getFinger(Zkteco $self, $uid, $finger)
{
$command = Util::CMD_USER_TEMP_RRQ;
$byte1 = chr((int)($uid % 256));
Expand Down Expand Up @@ -72,12 +72,12 @@ private function _getFinger(ZKTeco $self, $uid, $finger)
/**
* TODO: Still can not set fingerprint. Need more documentation about it...
*
* @param ZKTeco $self
* @param Zkteco $self
* @param int $uid Unique Employee ID in ZK device
* @param array $data Binary fingerprint data array (where key is finger ID (0-9) same like returned array from 'get' method)
* @return int Count of added fingerprints
*/
static public function set(ZKTeco $self, $uid, array $data)
static public function set(Zkteco $self, $uid, array $data)
{
$self->_section = __METHOD__;

Expand All @@ -98,11 +98,11 @@ static public function set(ZKTeco $self, $uid, array $data)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @param string $data Binary fingerprint data item
* @return bool|mixed
*/
private function _setFinger(ZKTeco $self, $data)
private function _setFinger(Zkteco $self, $data)
{
$command = Util::CMD_USER_TEMP_WRQ;
$command_string = $data;
Expand All @@ -111,12 +111,12 @@ private function _setFinger(ZKTeco $self, $data)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @param int $uid Unique Employee ID in ZK device
* @param array $data Fingers ID array (0-9)
* @return int Count of deleted fingerprints
*/
static public function remove(ZKTeco $self, $uid, array $data)
static public function remove(Zkteco $self, $uid, array $data)
{
$self->_section = __METHOD__;

Expand All @@ -134,12 +134,12 @@ static public function remove(ZKTeco $self, $uid, array $data)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @param int $uid Unique Employee ID in ZK device
* @param int $finger Finger ID (0-9)
* @return bool
*/
private function _removeFinger(ZKTeco $self, $uid, $finger)
private function _removeFinger(Zkteco $self, $uid, $finger)
{
$command = Util::CMD_DELETE_USER_TEMP;
$byte1 = chr((int)($uid % 256));
Expand All @@ -152,19 +152,19 @@ private function _removeFinger(ZKTeco $self, $uid, $finger)
}

/**
* @param ZKTeco $self
* @param Zkteco $self
* @param int $uid Unique Employee ID in ZK device
* @param int $finger Finger ID (0-9)
* @return bool Returned true if exist
*/
private function _checkFinger(ZKTeco $self, $uid, $finger)
private function _checkFinger(Zkteco $self, $uid, $finger)
{
$fingerPrint = new Fingerprint();
$res = $fingerPrint->_getFinger($self, $uid, $finger);
return (bool)($res['size'] > 0);
}

public static function startEnroll(ZKTeco $self, $uid, $finger)
public static function startEnroll(Zkteco $self, $uid, $finger)
{
$command = Util::CMD_STARTENROLL;
$byte1 = chr((int)($uid % 256));
Expand Down
6 changes: 3 additions & 3 deletions src/Lib/Helper/Os.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Os
{
/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function get(ZKTeco $self)
static public function get(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down
6 changes: 3 additions & 3 deletions src/Lib/Helper/Pin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Bmz\Zkteco\Lib\Helper;

use Bmz\Zkteco\Lib\ZKTeco;
use Bmz\Zkteco\Zkteco;

class Pin
{
/**
* @param ZKTeco $self
* @param Zkteco $self
* @return bool|mixed
*/
static public function width(ZKTeco $self)
static public function width(Zkteco $self)
{
$self->_section = __METHOD__;

Expand Down
Loading

0 comments on commit b05d597

Please sign in to comment.